]> Pileus Git - ~andy/gtk/blob - gdk/gdk.h
include gdkspawn.h.
[~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 #include <gdk/gdkcolor.h>
31 #include <gdk/gdkcursor.h>
32 #include <gdk/gdkdisplay.h>
33 #include <gdk/gdkdnd.h>
34 #include <gdk/gdkdrawable.h>
35 #include <gdk/gdkenumtypes.h>
36 #include <gdk/gdkevents.h>
37 #include <gdk/gdkfont.h>
38 #include <gdk/gdkgc.h>
39 #include <gdk/gdkimage.h>
40 #include <gdk/gdkinput.h>
41 #include <gdk/gdkkeys.h>
42 #include <gdk/gdkdisplaymanager.h>
43 #include <gdk/gdkpango.h>
44 #include <gdk/gdkpixbuf.h>
45 #include <gdk/gdkpixmap.h>
46 #include <gdk/gdkproperty.h>
47 #include <gdk/gdkregion.h>
48 #include <gdk/gdkrgb.h>
49 #include <gdk/gdkscreen.h>
50 #include <gdk/gdkselection.h>
51 #include <gdk/gdkspawn.h>
52 #include <gdk/gdktypes.h>
53 #include <gdk/gdkvisual.h>
54 #include <gdk/gdkwindow.h>
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif /* __cplusplus */
59
60
61 /* Initialization, exit and events
62  */
63 #define   GDK_PRIORITY_EVENTS           (G_PRIORITY_DEFAULT)
64 void      gdk_parse_args                (gint           *argc,
65                                          gchar        ***argv);
66 void      gdk_init                      (gint           *argc,
67                                          gchar        ***argv);
68 gboolean  gdk_init_check                (gint           *argc,
69                                          gchar        ***argv);
70
71 #ifndef GDK_DISABLE_DEPRECATED
72 void      gdk_exit                      (gint            error_code);
73 #endif /* GDK_DISABLE_DEPRECATED */
74 gchar*    gdk_set_locale                (void);
75
76 G_CONST_RETURN char *gdk_get_program_class (void);
77 void                 gdk_set_program_class (const char *program_class);
78
79 /* Push and pop error handlers for X errors
80  */
81 void      gdk_error_trap_push           (void);
82 gint      gdk_error_trap_pop            (void);
83
84 #ifndef GDK_DISABLE_DEPRECATED
85 void      gdk_set_use_xshm              (gboolean        use_xshm);
86 gboolean  gdk_get_use_xshm              (void);
87 #endif /* GDK_DISABLE_DEPRECATED */
88
89 gchar*                    gdk_get_display               (void);
90 G_CONST_RETURN gchar*     gdk_get_display_arg_name      (void);
91
92 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
93 /* Used by gtk_input_add_full () */
94 gint gdk_input_add_full   (gint              source,
95                            GdkInputCondition condition,
96                            GdkInputFunction  function,
97                            gpointer          data,
98                            GdkDestroyNotify  destroy);
99 #endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
100 #ifndef GDK_DISABLE_DEPRECATED
101 gint gdk_input_add        (gint              source,
102                            GdkInputCondition condition,
103                            GdkInputFunction  function,
104                            gpointer          data);
105 void gdk_input_remove     (gint              tag);
106 #endif /* GDK_DISABLE_DEPRECATED */
107
108 GdkGrabStatus gdk_pointer_grab       (GdkWindow    *window,
109                                       gboolean      owner_events,
110                                       GdkEventMask  event_mask,
111                                       GdkWindow    *confine_to,
112                                       GdkCursor    *cursor,
113                                       guint32       time_);
114 GdkGrabStatus gdk_keyboard_grab      (GdkWindow    *window,
115                                       gboolean      owner_events,
116                                       guint32       time_);
117
118 #ifndef GDK_MULTIHEAD_SAFE
119 void          gdk_pointer_ungrab     (guint32       time_);
120 void          gdk_keyboard_ungrab    (guint32       time_);
121 gboolean      gdk_pointer_is_grabbed (void);
122
123 gint gdk_screen_width  (void) G_GNUC_CONST;
124 gint gdk_screen_height (void) G_GNUC_CONST;
125
126 gint gdk_screen_width_mm  (void) G_GNUC_CONST;
127 gint gdk_screen_height_mm (void) G_GNUC_CONST;
128
129 void gdk_beep (void);
130 #endif /* GDK_MULTIHEAD_SAFE */
131
132 void gdk_flush (void);
133
134 #ifndef GDK_MULTIHEAD_SAFE
135 void gdk_set_double_click_time             (guint       msec);
136 #endif
137
138 /* Rectangle utilities
139  */
140 gboolean gdk_rectangle_intersect (GdkRectangle *src1,
141                                   GdkRectangle *src2,
142                                   GdkRectangle *dest);
143 void     gdk_rectangle_union     (GdkRectangle *src1,
144                                   GdkRectangle *src2,
145                                   GdkRectangle *dest);
146
147 GType gdk_rectangle_get_type (void);
148
149 #define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ())
150
151 /* Conversion functions between wide char and multibyte strings. 
152  */
153 #ifndef GDK_DISABLE_DEPRECATED
154 gchar     *gdk_wcstombs          (const GdkWChar   *src);
155 gint       gdk_mbstowcs          (GdkWChar         *dest,
156                                   const gchar      *src,
157                                   gint              dest_max);
158 #endif
159
160 /* Miscellaneous */
161 #ifndef GDK_MULTIHEAD_SAFE
162 gboolean gdk_event_send_client_message      (GdkEvent       *event,
163                                              GdkNativeWindow winid);
164 void     gdk_event_send_clientmessage_toall (GdkEvent  *event);
165 #endif
166 gboolean gdk_event_send_client_message_for_display (GdkDisplay *display,
167                                                     GdkEvent       *event,
168                                                     GdkNativeWindow winid);
169
170 void gdk_notify_startup_complete (void);
171
172 /* Threading
173  */
174
175 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
176 GDKVAR GMutex *gdk_threads_mutex; /* private */
177 #endif
178
179 GDKVAR GCallback gdk_threads_lock;
180 GDKVAR GCallback gdk_threads_unlock;
181
182 void     gdk_threads_enter                (void);
183 void     gdk_threads_leave                (void);
184 void     gdk_threads_init                 (void);
185 void     gdk_threads_set_lock_functions   (GCallback enter_fn,
186                                            GCallback leave_fn);
187
188 #ifdef  G_THREADS_ENABLED
189 #  define GDK_THREADS_ENTER()   G_STMT_START {  \
190       if (gdk_threads_lock)                     \
191         (*gdk_threads_lock) ();                 \
192    } G_STMT_END
193 #  define GDK_THREADS_LEAVE()   G_STMT_START {  \
194       if (gdk_threads_unlock)                   \
195         (*gdk_threads_unlock) ();               \
196    } G_STMT_END
197 #else   /* !G_THREADS_ENABLED */
198 #  define GDK_THREADS_ENTER()
199 #  define GDK_THREADS_LEAVE()
200 #endif  /* !G_THREADS_ENABLED */
201
202 #ifdef __cplusplus
203 }
204 #endif /* __cplusplus */
205
206
207 #endif /* __GDK_H__ */