| 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/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 | gchar* gdk_set_locale (void); |
| 81 | #endif /* GDK_DISABLE_DEPRECATED */ |
| 82 | |
| 83 | const 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 | const gchar* gdk_get_display_arg_name (void); |
| 98 | |
| 99 | #ifndef GDK_DISABLE_DEPRECATED |
| 100 | gint gdk_input_add_full (gint source, |
| 101 | GdkInputCondition condition, |
| 102 | GdkInputFunction function, |
| 103 | gpointer data, |
| 104 | GDestroyNotify destroy); |
| 105 | gint gdk_input_add (gint source, |
| 106 | GdkInputCondition condition, |
| 107 | GdkInputFunction function, |
| 108 | gpointer data); |
| 109 | void gdk_input_remove (gint tag); |
| 110 | #endif /* GDK_DISABLE_DEPRECATED */ |
| 111 | |
| 112 | GdkGrabStatus gdk_pointer_grab (GdkWindow *window, |
| 113 | gboolean owner_events, |
| 114 | GdkEventMask event_mask, |
| 115 | GdkWindow *confine_to, |
| 116 | GdkCursor *cursor, |
| 117 | guint32 time_); |
| 118 | GdkGrabStatus gdk_keyboard_grab (GdkWindow *window, |
| 119 | gboolean owner_events, |
| 120 | guint32 time_); |
| 121 | |
| 122 | gboolean gdk_pointer_grab_info_libgtk_only (GdkDisplay *display, |
| 123 | GdkWindow **grab_window, |
| 124 | gboolean *owner_events); |
| 125 | gboolean gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display, |
| 126 | GdkWindow **grab_window, |
| 127 | gboolean *owner_events); |
| 128 | |
| 129 | #ifndef GDK_MULTIHEAD_SAFE |
| 130 | void gdk_pointer_ungrab (guint32 time_); |
| 131 | void gdk_keyboard_ungrab (guint32 time_); |
| 132 | gboolean gdk_pointer_is_grabbed (void); |
| 133 | |
| 134 | gint gdk_screen_width (void) G_GNUC_CONST; |
| 135 | gint gdk_screen_height (void) G_GNUC_CONST; |
| 136 | |
| 137 | gint gdk_screen_width_mm (void) G_GNUC_CONST; |
| 138 | gint gdk_screen_height_mm (void) G_GNUC_CONST; |
| 139 | |
| 140 | void gdk_beep (void); |
| 141 | #endif /* GDK_MULTIHEAD_SAFE */ |
| 142 | |
| 143 | void gdk_flush (void); |
| 144 | |
| 145 | #ifndef GDK_MULTIHEAD_SAFE |
| 146 | void gdk_set_double_click_time (guint msec); |
| 147 | #endif |
| 148 | |
| 149 | /* Rectangle utilities |
| 150 | */ |
| 151 | gboolean gdk_rectangle_intersect (const GdkRectangle *src1, |
| 152 | const GdkRectangle *src2, |
| 153 | GdkRectangle *dest); |
| 154 | void gdk_rectangle_union (const GdkRectangle *src1, |
| 155 | const GdkRectangle *src2, |
| 156 | GdkRectangle *dest); |
| 157 | |
| 158 | GType gdk_rectangle_get_type (void) G_GNUC_CONST; |
| 159 | |
| 160 | #define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ()) |
| 161 | |
| 162 | /* Conversion functions between wide char and multibyte strings. |
| 163 | */ |
| 164 | #ifndef GDK_DISABLE_DEPRECATED |
| 165 | gchar *gdk_wcstombs (const GdkWChar *src); |
| 166 | gint gdk_mbstowcs (GdkWChar *dest, |
| 167 | const gchar *src, |
| 168 | gint dest_max); |
| 169 | #endif |
| 170 | |
| 171 | /* Miscellaneous */ |
| 172 | #ifndef GDK_MULTIHEAD_SAFE |
| 173 | gboolean gdk_event_send_client_message (GdkEvent *event, |
| 174 | GdkNativeWindow winid); |
| 175 | void gdk_event_send_clientmessage_toall (GdkEvent *event); |
| 176 | #endif |
| 177 | gboolean gdk_event_send_client_message_for_display (GdkDisplay *display, |
| 178 | GdkEvent *event, |
| 179 | GdkNativeWindow winid); |
| 180 | |
| 181 | void gdk_notify_startup_complete (void); |
| 182 | |
| 183 | void gdk_notify_startup_complete_with_id (const gchar* startup_id); |
| 184 | |
| 185 | /* Threading |
| 186 | */ |
| 187 | |
| 188 | #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION) |
| 189 | GDKVAR GMutex *gdk_threads_mutex; /* private */ |
| 190 | #endif |
| 191 | |
| 192 | GDKVAR GCallback gdk_threads_lock; |
| 193 | GDKVAR GCallback gdk_threads_unlock; |
| 194 | |
| 195 | void gdk_threads_enter (void); |
| 196 | void gdk_threads_leave (void); |
| 197 | void gdk_threads_init (void); |
| 198 | void gdk_threads_set_lock_functions (GCallback enter_fn, |
| 199 | GCallback leave_fn); |
| 200 | |
| 201 | guint gdk_threads_add_idle_full (gint priority, |
| 202 | GSourceFunc function, |
| 203 | gpointer data, |
| 204 | GDestroyNotify notify); |
| 205 | guint gdk_threads_add_idle (GSourceFunc function, |
| 206 | gpointer data); |
| 207 | guint gdk_threads_add_timeout_full (gint priority, |
| 208 | guint interval, |
| 209 | GSourceFunc function, |
| 210 | gpointer data, |
| 211 | GDestroyNotify notify); |
| 212 | guint gdk_threads_add_timeout (guint interval, |
| 213 | GSourceFunc function, |
| 214 | gpointer data); |
| 215 | guint gdk_threads_add_timeout_seconds_full (gint priority, |
| 216 | guint interval, |
| 217 | GSourceFunc function, |
| 218 | gpointer data, |
| 219 | GDestroyNotify notify); |
| 220 | guint gdk_threads_add_timeout_seconds (guint interval, |
| 221 | GSourceFunc function, |
| 222 | gpointer data); |
| 223 | |
| 224 | #ifdef G_THREADS_ENABLED |
| 225 | # define GDK_THREADS_ENTER() G_STMT_START { \ |
| 226 | if (gdk_threads_lock) \ |
| 227 | (*gdk_threads_lock) (); \ |
| 228 | } G_STMT_END |
| 229 | # define GDK_THREADS_LEAVE() G_STMT_START { \ |
| 230 | if (gdk_threads_unlock) \ |
| 231 | (*gdk_threads_unlock) (); \ |
| 232 | } G_STMT_END |
| 233 | #else /* !G_THREADS_ENABLED */ |
| 234 | # define GDK_THREADS_ENTER() |
| 235 | # define GDK_THREADS_LEAVE() |
| 236 | #endif /* !G_THREADS_ENABLED */ |
| 237 | |
| 238 | G_END_DECLS |
| 239 | |
| 240 | |
| 241 | #endif /* __GDK_H__ */ |
| 242 | |