]> Pileus Git - ~andy/gtk/blob - gdk/gdk.h
Merges from gtk-1-2
[~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 Library 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library 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-1999.  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/gdkcc.h>
31 #include <gdk/gdkcolor.h>
32 #include <gdk/gdkcursor.h>
33 #include <gdk/gdkdnd.h>
34 #include <gdk/gdkdrawable.h>
35 #include <gdk/gdkevents.h>
36 #include <gdk/gdkfont.h>
37 #include <gdk/gdkgc.h>
38 #include <gdk/gdkim.h>
39 #include <gdk/gdkimage.h>
40 #include <gdk/gdkinput.h>
41 #include <gdk/gdkpixmap.h>
42 #include <gdk/gdkproperty.h>
43 #include <gdk/gdkregion.h>
44 #include <gdk/gdkrgb.h>
45 #include <gdk/gdkselection.h>
46 #include <gdk/gdktypes.h>
47 #include <gdk/gdkvisual.h>
48 #include <gdk/gdkwindow.h>
49
50 #include <gdk/gdkcompat.h>
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif /* __cplusplus */
55
56
57 /* Initialization, exit and events
58  */
59 #define   GDK_PRIORITY_EVENTS           (G_PRIORITY_DEFAULT)
60 void      gdk_init                      (gint           *argc,
61                                          gchar        ***argv);
62 gboolean  gdk_init_check                (gint           *argc,
63                                          gchar        ***argv);
64 void      gdk_exit                      (gint            error_code);
65 gchar*    gdk_set_locale                (void);
66
67 /* Push and pop error handlers for X errors
68  */
69 void      gdk_error_trap_push           (void);
70 gint      gdk_error_trap_pop            (void);
71
72
73 void      gdk_set_use_xshm              (gboolean        use_xshm);
74
75 gboolean  gdk_get_use_xshm              (void);
76 gchar*    gdk_get_display               (void);
77
78 gint gdk_input_add_full   (gint              source,
79                            GdkInputCondition condition,
80                            GdkInputFunction  function,
81                            gpointer          data,
82                            GdkDestroyNotify  destroy);
83 gint gdk_input_add        (gint              source,
84                            GdkInputCondition condition,
85                            GdkInputFunction  function,
86                            gpointer          data);
87 void gdk_input_remove     (gint              tag);
88
89 gint     gdk_pointer_grab       (GdkWindow    *window,
90                                  gboolean      owner_events,
91                                  GdkEventMask  event_mask,
92                                  GdkWindow    *confine_to,
93                                  GdkCursor    *cursor,
94                                  guint32       time);
95 void     gdk_pointer_ungrab     (guint32       time);
96 gint     gdk_keyboard_grab      (GdkWindow    *window,
97                                  gboolean      owner_events,
98                                  guint32       time);
99 void     gdk_keyboard_ungrab    (guint32       time);
100 gboolean gdk_pointer_is_grabbed (void);
101
102 gint gdk_screen_width  (void);
103 gint gdk_screen_height (void);
104
105 gint gdk_screen_width_mm  (void);
106 gint gdk_screen_height_mm (void);
107
108 void gdk_flush (void);
109 void gdk_beep (void);
110
111 void gdk_key_repeat_disable (void);
112 void gdk_key_repeat_restore (void);
113
114 /* Rectangle utilities
115  */
116 gboolean gdk_rectangle_intersect (GdkRectangle *src1,
117                                   GdkRectangle *src2,
118                                   GdkRectangle *dest);
119 void     gdk_rectangle_union     (GdkRectangle *src1,
120                                   GdkRectangle *src2,
121                                   GdkRectangle *dest);
122
123 /* Conversion functions between wide char and multibyte strings. 
124  */
125 gchar     *gdk_wcstombs          (const GdkWChar   *src);
126 gint       gdk_mbstowcs          (GdkWChar         *dest,
127                                   const gchar      *src,
128                                   gint              dest_max);
129
130 /* Miscellaneous */
131 void     gdk_event_send_clientmessage_toall (GdkEvent    *event);
132 gboolean gdk_event_send_client_message (GdkEvent    *event,
133                                         guint32      xid);
134
135 /* Key values
136  */
137 gchar*   gdk_keyval_name         (guint        keyval);
138 guint    gdk_keyval_from_name    (const gchar *keyval_name);
139 void     gdk_keyval_convert_case (guint        symbol,
140                                   guint       *lower,
141                                   guint       *upper);
142 guint    gdk_keyval_to_upper     (guint        keyval);
143 guint    gdk_keyval_to_lower     (guint        keyval);
144 gboolean gdk_keyval_is_upper     (guint        keyval);
145 gboolean gdk_keyval_is_lower     (guint        keyval);
146
147
148 /* Threading
149  */
150
151 GDKVAR GMutex *gdk_threads_mutex;
152
153 void     gdk_threads_enter                (void);
154 void     gdk_threads_leave                (void);
155
156 #ifdef  G_THREADS_ENABLED
157 #  define GDK_THREADS_ENTER()   G_STMT_START {  \
158       if (gdk_threads_mutex)                    \
159         g_mutex_lock (gdk_threads_mutex);       \
160    } G_STMT_END
161 #  define GDK_THREADS_LEAVE()   G_STMT_START {  \
162       if (gdk_threads_mutex)                    \
163         g_mutex_unlock (gdk_threads_mutex);     \
164    } G_STMT_END
165 #else   /* !G_THREADS_ENABLED */
166 #  define GDK_THREADS_ENTER()
167 #  define GDK_THREADS_LEAVE()
168 #endif  /* !G_THREADS_ENABLED */
169
170 #ifdef __cplusplus
171 }
172 #endif /* __cplusplus */
173
174
175 #endif /* __GDK_H__ */