]> Pileus Git - ~andy/gtk/blob - gdk/gdk.h
Practically everything changed.
[~andy/gtk] / gdk / gdk.h
1 /* GDK - The GTK+ 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/gdkdisplay.h>
37 #include <gdk/gdkdisplaymanager.h>
38 #include <gdk/gdkdnd.h>
39 #include <gdk/gdkdrawable.h>
40 #include <gdk/gdkenumtypes.h>
41 #include <gdk/gdkevents.h>
42 #include <gdk/gdkfont.h>
43 #include <gdk/gdkgc.h>
44 #include <gdk/gdkimage.h>
45 #include <gdk/gdkinput.h>
46 #include <gdk/gdkkeys.h>
47 #include <gdk/gdkpango.h>
48 #include <gdk/gdkpixbuf.h>
49 #include <gdk/gdkpixmap.h>
50 #include <gdk/gdkproperty.h>
51 #include <gdk/gdkregion.h>
52 #include <gdk/gdkrgb.h>
53 #include <gdk/gdkscreen.h>
54 #include <gdk/gdkselection.h>
55 #include <gdk/gdkspawn.h>
56 #include <gdk/gdktestutils.h>
57 #include <gdk/gdktypes.h>
58 #include <gdk/gdkvisual.h>
59 #include <gdk/gdkwindow.h>
60
61 #undef __GDK_H_INSIDE__
62
63 G_BEGIN_DECLS
64
65
66 /* Initialization, exit and events
67  */
68 #define   GDK_PRIORITY_EVENTS           (G_PRIORITY_DEFAULT)
69 void      gdk_parse_args                (gint           *argc,
70                                          gchar        ***argv);
71 void      gdk_init                      (gint           *argc,
72                                          gchar        ***argv);
73 gboolean  gdk_init_check                (gint           *argc,
74                                          gchar        ***argv);
75 void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
76 void gdk_pre_parse_libgtk_only          (void);
77
78 #ifndef GDK_DISABLE_DEPRECATED
79 void      gdk_exit                      (gint            error_code);
80 #endif /* GDK_DISABLE_DEPRECATED */
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 #ifndef GDK_DISABLE_DEPRECATED
92 void      gdk_set_use_xshm              (gboolean        use_xshm);
93 gboolean  gdk_get_use_xshm              (void);
94 #endif /* GDK_DISABLE_DEPRECATED */
95
96 gchar*                    gdk_get_display               (void);
97 G_CONST_RETURN gchar*     gdk_get_display_arg_name      (void);
98
99 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
100 /* Used by gtk_input_add_full () */
101 gint gdk_input_add_full   (gint              source,
102                            GdkInputCondition condition,
103                            GdkInputFunction  function,
104                            gpointer          data,
105                            GDestroyNotify    destroy);
106 #endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
107 #ifndef GDK_DISABLE_DEPRECATED
108 gint gdk_input_add        (gint              source,
109                            GdkInputCondition condition,
110                            GdkInputFunction  function,
111                            gpointer          data);
112 void gdk_input_remove     (gint              tag);
113 #endif /* GDK_DISABLE_DEPRECATED */
114
115 GdkGrabStatus gdk_pointer_grab       (GdkWindow    *window,
116                                       gboolean      owner_events,
117                                       GdkEventMask  event_mask,
118                                       GdkWindow    *confine_to,
119                                       GdkCursor    *cursor,
120                                       guint32       time_);
121 GdkGrabStatus gdk_keyboard_grab      (GdkWindow    *window,
122                                       gboolean      owner_events,
123                                       guint32       time_);
124
125 gboolean gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
126                                             GdkWindow **grab_window,
127                                             gboolean   *owner_events);
128 gboolean gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,
129                                              GdkWindow **grab_window,
130                                              gboolean   *owner_events);
131
132 #ifndef GDK_MULTIHEAD_SAFE
133 void          gdk_pointer_ungrab     (guint32       time_);
134 void          gdk_keyboard_ungrab    (guint32       time_);
135 gboolean      gdk_pointer_is_grabbed (void);
136
137 gint gdk_screen_width  (void) G_GNUC_CONST;
138 gint gdk_screen_height (void) G_GNUC_CONST;
139
140 gint gdk_screen_width_mm  (void) G_GNUC_CONST;
141 gint gdk_screen_height_mm (void) G_GNUC_CONST;
142
143 void gdk_beep (void);
144 #endif /* GDK_MULTIHEAD_SAFE */
145
146 void gdk_flush (void);
147
148 #ifndef GDK_MULTIHEAD_SAFE
149 void gdk_set_double_click_time             (guint       msec);
150 #endif
151
152 /* Rectangle utilities
153  */
154 gboolean gdk_rectangle_intersect (const GdkRectangle *src1,
155                                   const GdkRectangle *src2,
156                                   GdkRectangle       *dest);
157 void     gdk_rectangle_union     (const GdkRectangle *src1,
158                                   const GdkRectangle *src2,
159                                   GdkRectangle       *dest);
160
161 GType gdk_rectangle_get_type (void) G_GNUC_CONST;
162
163 #define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ())
164
165 /* Conversion functions between wide char and multibyte strings. 
166  */
167 #ifndef GDK_DISABLE_DEPRECATED
168 gchar     *gdk_wcstombs          (const GdkWChar   *src);
169 gint       gdk_mbstowcs          (GdkWChar         *dest,
170                                   const gchar      *src,
171                                   gint              dest_max);
172 #endif
173
174 /* Miscellaneous */
175 #ifndef GDK_MULTIHEAD_SAFE
176 gboolean gdk_event_send_client_message      (GdkEvent       *event,
177                                              GdkNativeWindow winid);
178 void     gdk_event_send_clientmessage_toall (GdkEvent  *event);
179 #endif
180 gboolean gdk_event_send_client_message_for_display (GdkDisplay *display,
181                                                     GdkEvent       *event,
182                                                     GdkNativeWindow winid);
183
184 void gdk_notify_startup_complete (void);
185
186 void gdk_notify_startup_complete_with_id (const gchar* startup_id);
187
188 /* Threading
189  */
190
191 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
192 GDKVAR GMutex *gdk_threads_mutex; /* private */
193 #endif
194
195 GDKVAR GCallback gdk_threads_lock;
196 GDKVAR GCallback gdk_threads_unlock;
197
198 void     gdk_threads_enter                (void);
199 void     gdk_threads_leave                (void);
200 void     gdk_threads_init                 (void);
201 void     gdk_threads_set_lock_functions   (GCallback enter_fn,
202                                            GCallback leave_fn);
203
204 guint    gdk_threads_add_idle_full        (gint           priority,
205                                            GSourceFunc    function,
206                                            gpointer       data,
207                                            GDestroyNotify notify);
208 guint    gdk_threads_add_idle             (GSourceFunc    function,
209                                            gpointer       data);
210 guint    gdk_threads_add_timeout_full     (gint           priority,
211                                            guint          interval,
212                                            GSourceFunc    function,
213                                            gpointer       data,
214                                            GDestroyNotify notify);
215 guint    gdk_threads_add_timeout          (guint          interval,
216                                            GSourceFunc    function,
217                                            gpointer       data);
218
219 #ifdef  G_THREADS_ENABLED
220 #  define GDK_THREADS_ENTER()   G_STMT_START {  \
221       if (gdk_threads_lock)                     \
222         (*gdk_threads_lock) ();                 \
223    } G_STMT_END
224 #  define GDK_THREADS_LEAVE()   G_STMT_START {  \
225       if (gdk_threads_unlock)                   \
226         (*gdk_threads_unlock) ();               \
227    } G_STMT_END
228 #else   /* !G_THREADS_ENABLED */
229 #  define GDK_THREADS_ENTER()
230 #  define GDK_THREADS_LEAVE()
231 #endif  /* !G_THREADS_ENABLED */
232
233 G_END_DECLS
234
235
236 #endif /* __GDK_H__ */