Commit a0c84d68 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Commented out testthreads from the build process, since we won't have any

Tue Dec 15 01:38:53 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am: Commented out testthreads from
	the build process, since we won't have any idea
	how to create a thread.

	* configure.in (LIBS): use glib-config ... gthread
	so we always build a thread-compatible library.

        * gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
	  gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
	  gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
	  gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
	  gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:

	Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
	and idles to account for the fact that they are no
	longer called within the GTK+ lock.

	* gtk/gtkprivate.h: Added definitions for locking
	the main GTK+ mutex.

	* gtk/gtkmain.c: Re-implement the main loop
	in terms of the GLib main loop.

	* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
	functionality, as it seems better to subsume GDK within the
	GTK+ lock than vice-versa.

        * gdk/gdkevents.c: New file, containing event handling bits
	from gdk.c.

	* gdk/gdkevents.c: Implement event source for GDK
	events.

	* configure.in gdk/gdkevents.c: Removed attempts to
	subtract base_id, which were already non-functional.
parent 58475f05
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
Tue Dec 15 01:38:53 1998 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Commented out testthreads from
the build process, since we won't have any idea
how to create a thread.
* configure.in (LIBS): use glib-config ... gthread
so we always build a thread-compatible library.
* gtk/gtkaccellabel.c gtk/gtkclist.c gtk/gtkcolorsel.c
gtk/gtkcombo.c gtk/gtkcontainer.c gtk/gtkentry.c
gtk/gtklist.c gtk/gtkmenuitem.c gtk/gtknotebook.c
gtk/gtkrange.c gtk/gtkselection.c gtk/gtkspinbutton.c
gtk/gtktext.c gtk/gtktooltips.c gtk/gtkwidget.c:
Add GTK_THREADS_ENTER/LEAVE pairs around timeouts
and idles to account for the fact that they are no
longer called within the GTK+ lock.
* gtk/gtkprivate.h: Added definitions for locking
the main GTK+ mutex.
* gtk/gtkmain.c: Re-implement the main loop
in terms of the GLib main loop.
* gdk/gdk.h gdk/gdkthreads.c gdk/Makefile.am: Removed threading
functionality, as it seems better to subsume GDK within the
GTK+ lock than vice-versa.
* gdk/gdkevents.c: New file, containing event handling bits
from gdk.c.
* gdk/gdkevents.c: Implement event source for GDK
events.
* configure.in gdk/gdkevents.c: Removed attempts to
subtract base_id, which were already non-functional.
Mon Dec 14 23:05:20 PST 1998 Manish Singh <yosh@gimp.org>
* acconfig.h
......@@ -871,6 +909,8 @@ Tue Nov 24 11:31:06 1998 Owen Taylor <otaylor@redhat.com>
* testgtk.c: Modified layout test to test scrolling over
long distances.
* gtk/gtkplug.c: Added a few blank lines.
Tue Nov 24 11:11:05 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.[ch]: Fixed up copyright message.
......
......@@ -66,11 +66,6 @@
#undef NO_FD_SET
#undef RESOURCE_BASE
/* Define to enable POSIX threading awareness */
#undef USE_PTHREADS
#undef XINPUT_NONE
#undef XINPUT_GXI
#undef XINPUT_XFREE
......
......@@ -184,7 +184,7 @@ if test x$with_glib = x ; then
AC_MSG_ERROR([
*** GLIB 1.1.6 or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org.]),
gmodule)
gmodule gthread)
glib_cflags=$GLIB_CFLAGS
glib_libs=$GLIB_LIBS
......@@ -305,20 +305,6 @@ else
AC_DEFINE(XINPUT_NONE)
fi
# Threads
if test "x$with_threads" = "xposix" || test "x$with_threads" = "xyes"; then
AC_CHECK_LIB(pthread, pthread_attr_init,
[AC_DEFINE(USE_PTHREADS)
x_libs="$x_libs -lpthread"
GTK_THREAD_FLAGS="-D_REENTRANT"],
# AIX has libpthreads, cause they're special. Special friends (TM)
AC_CHECK_LIB(pthreads, pthread_attr_init,
[AC_DEFINE(USE_PTHREADS)
x_libs="$x_libs -lpthreads"
GTK_THREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE"]))
fi
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
......@@ -349,27 +335,6 @@ if test "x$enable_shm" = "xyes"; then
fi
fi
# Check for private display resource base variable
AC_MSG_CHECKING(resource base field in XDisplay)
AC_CACHE_VAL(gtk_cv_display_resource_base,
[AC_TRY_RUN([
#define XLIB_ILLEGAL_ACCESS
#include <X11/Xlib.h>
int
main ()
{
Display *display;
return 0;
display->resource_base;
}],
gtk_cv_display_resource_base="resource_base",
gtk_cv_display_resource_base="private3")])
AC_MSG_RESULT($gtk_cv_display_resource_base)
AC_DEFINE_UNQUOTED(RESOURCE_BASE, gdk_display->$gtk_cv_display_resource_base)
# Check if X_LOCALE definition is necessary
AC_MSG_CHECKING(need -DX_LOCALE)
......
......@@ -84,23 +84,76 @@ Incompatible Changes from GTK+-1.0 to GTK+-1.2:
Window. The scrollbar policy is set on the scrolled window with
gtk_scrolled_window_set_policy() and not on the child widgets
(e.g. GtkCList's gtk_clist_set_policy() was removed).
* The "main loop" of GTK+ has been moved to GLib. This should not
affect existing programs, since compatibility functions have
been provided. However, you may want to consider migrating
your code to use the GLib main loop directly.
Minor known incompatibilities:
* the GTK_BASIC flag got removed, and with it the corresponding
- gtk_idle_remove_by_data() and gtk_timeout_remove_by_data() now
work from a common pool of "input sources", so
gtk_idle_remove_by_data() will remove timeouts and
vice-versa.
* the GTK_BASIC flag was removed, and with it the corresponding
macro and function GTK_WIDGET_BASIC() and gtk_widget_basic().
* all freeze/thaw methods in gtk work in an incremental way now.
code portions like:
* All freeze/thaw methods are now recursive - that is, if you
freeze a widget n times, you must also thaw it n times.
Therefore, if you have code like:
gboolean frozen;
frozen = GTK_CLIST_FROZEN (clist);
gtk_clist_freeze (clist);
[...]
if (!frozen)
gtk_clist_thaw (clist);
will not work anymore, they have to be modified to simply:
it will not work anymore. It must be, simply:
gtk_clist_freeze (clist);
[...]
gtk_clist_thaw (clist);
* The thread safety in GTK+ 1.2 is slightly different than
that which appeared in early versions in the 1.1
development track. The main difference is that it relies on
the thread primitives in GLib, and on the thread-safe
GLib main loop.
This means:
- You must call g_thread_init(), then gtk_thread_init()
in a threaded GTK+ program.
- Idles, timeouts, and input functions are executed outside
of the main GTK+ lock. So, if you need to call GTK+
inside of such a callback, you must surround the callback
with a gtk_thread_enter()/gtk_thread_leave() pair.
[ However, signals are still executed within the main
GTK+ lock ]
In particular, this means, if you are writing widgets
that might be used in threaded programs, you _must_
surround timeouts and idle functions in this matter.
- There is no longer a special --with-threads configure
option for GTK+. To use threads in a GTK+ program, you
must:
a) If you want to use the native thread implementation,
make sure GLib found this in configuration, otherwise,
call you must provide a thread implementation to
g_thread_init().
b) Link with the libraries returned by:
gtk-config --libs gthread
* All functions matching g_message* are deprecated
* Functions *_interp are deprecated, *_full variants are available
......
......@@ -21,6 +21,7 @@ libgdk_la_SOURCES = \
gdkcursor.c \
gdkdnd.c \
gdkdraw.c \
gdkevents.c \
gdkfont.c \
gdkgc.c \
gdkglobals.c \
......@@ -38,7 +39,6 @@ libgdk_la_SOURCES = \
gdkrectangle.c \
gdkregion.c \
gdkselection.c \
gdkthreads.c \
gdkvisual.c \
gdkwindow.c \
gdkxid.c \
......
This diff is collapsed.
......@@ -37,12 +37,16 @@ gchar* gdk_set_locale (void);
gint gdk_events_pending (void);
GdkEvent *gdk_event_get (void);
GdkEvent *gdk_event_get_graphics_expose (GdkWindow *window);
void gdk_event_put (GdkEvent *event);
void gdk_event_put (GdkEvent *event);
GdkEvent *gdk_event_copy (GdkEvent *event);
void gdk_event_free (GdkEvent *event);
guint32 gdk_event_get_time (GdkEvent *event);
void gdk_event_handler_set (GdkEventFunc func,
gpointer data,
GDestroyNotify notify);
void gdk_set_show_events (gint show_events);
void gdk_set_use_xshm (gint use_xshm);
......@@ -933,18 +937,6 @@ GdkRegion* gdk_regions_subtract (GdkRegion *source1,
GdkRegion* gdk_regions_xor (GdkRegion *source1,
GdkRegion *source2);
/* Threads
*/
gboolean gdk_threads_init (void);
void gdk_threads_enter (void);
void gdk_threads_leave (void);
/* If the mainloop thread is in its select, wake it up.
* For GTK's idle handling
*/
void gdk_threads_wake (void);
/* Miscellaneous */
void gdk_event_send_clientmessage_toall (GdkEvent *event);
gboolean gdk_event_send_client_message (GdkEvent *event,
......
......@@ -54,6 +54,14 @@ gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;
gboolean gdk_xim_using; /* using XIM Protocol if TRUE */
GdkICPrivate *gdk_xim_ic; /* currently using IC */
GdkWindow *gdk_xim_window; /* currently using Widow */
GdkWindowPrivate *gdk_xgrab_window = NULL; /* Window that currently holds the
* x pointer grab
*/
gboolean gdk_using_threads = FALSE;
/* Used to signal the mainloop thread from its select() */
......
......@@ -1235,8 +1235,6 @@ gdk_ic_get_events (GdkIC *ic)
gint i;
/* From gdkwindow.c */
extern int nevent_masks;
extern int event_mask_table[];
g_return_val_if_fail (ic != NULL, 0);
......@@ -1252,11 +1250,11 @@ gdk_ic_get_events (GdkIC *ic)
}
mask = 0;
for (i=0, bit=2; i < nevent_masks; i++, bit <<= 1)
if (xmask & event_mask_table [i])
for (i=0, bit=2; i < gdk_nevent_masks; i++, bit <<= 1)
if (xmask & gdk_event_mask_table [i])
{
mask |= bit;
xmask &= ~ event_mask_table [i];
xmask &= ~ gdk_event_mask_table [i];
}
if (xmask)
......
......@@ -218,6 +218,7 @@ typedef enum {
GDK_DEBUG_XIM = 1 << 4
} GdkDebugFlag;
void gdk_events_init (void);
void gdk_window_init (void);
void gdk_visual_init (void);
void gdk_dnd_init (void);
......@@ -276,6 +277,12 @@ extern gint gdk_error_warnings;
extern gint gdk_null_window_warnings;
extern GList *gdk_default_filters;
extern gboolean gdk_using_threads;
extern const int gdk_nevent_masks;
extern const int gdk_event_mask_table[];
extern GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the
* x pointer grab
*/
/* Threading stuff */
#ifdef USE_PTHREADS
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gdk.h"
#include "gdkprivate.h"
#ifdef USE_PTHREADS
#include <unistd.h>
#include <pthread.h>
pthread_mutex_t gdk_threads_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif /* USE_PTHREADS */
gboolean
gdk_threads_init (void)
{
#ifdef USE_PTHREADS
pipe (gdk_threads_pipe);
gdk_using_threads = TRUE;
return TRUE;
#else
return FALSE;
#endif
}
void
gdk_threads_enter (void)
{
#ifdef USE_PTHREADS
pthread_mutex_lock (&gdk_threads_mutex);
#endif
}
void
gdk_threads_leave (void)
{
#ifdef USE_PTHREADS
pthread_mutex_unlock (&gdk_threads_mutex);
#endif
}
void
gdk_threads_wake (void)
{
#ifdef USE_PTHREADS
if (gdk_select_waiting)
{
gdk_select_waiting = FALSE;
write (gdk_threads_pipe[1], "A", 1);
}
#endif
}
......@@ -86,7 +86,7 @@ typedef struct _GdkDeviceKey GdkDeviceKey;
typedef struct _GdkDeviceInfo GdkDeviceInfo;
typedef struct _GdkTimeCoord GdkTimeCoord;
typedef struct _GdkRegion GdkRegion;
typedef gint (*GdkEventFunc) (GdkEvent *event,
typedef void (*GdkEventFunc) (GdkEvent *event,
gpointer data);
typedef struct _GdkIC GdkIC;
......
......@@ -33,7 +33,7 @@
#include <X11/extensions/shape.h>
#endif
const int event_mask_table[20] =
const int gdk_event_mask_table[20] =
{
ExposureMask,
PointerMotionMask,
......@@ -56,7 +56,7 @@ const int event_mask_table[20] =
0, /* PROXIMTY_OUT */
SubstructureNotifyMask
};
const int nevent_masks = sizeof(event_mask_table)/sizeof(int);
const int gdk_nevent_masks = sizeof(gdk_event_mask_table)/sizeof(int);
static gboolean gdk_window_have_shape_ext (void);
......@@ -299,10 +299,10 @@ gdk_window_new (GdkWindow *parent,
xvisual = ((GdkVisualPrivate*) visual)->xvisual;
xattributes.event_mask = StructureNotifyMask;
for (i = 0; i < nevent_masks; i++)
for (i = 0; i < gdk_nevent_masks; i++)
{
if (attributes->event_mask & (1 << (i + 1)))
xattributes.event_mask |= event_mask_table[i];
xattributes.event_mask |= gdk_event_mask_table[i];
}
if (xattributes.event_mask)
......@@ -1703,9 +1703,9 @@ gdk_window_get_events (GdkWindow *window)
&attrs);
event_mask = 0;
for (i = 0; i < nevent_masks; i++)
for (i = 0; i < gdk_nevent_masks; i++)
{
if (attrs.your_event_mask & event_mask_table[i])
if (attrs.your_event_mask & gdk_event_mask_table[i])
event_mask |= 1 << (i + 1);
}
......@@ -1727,10 +1727,10 @@ gdk_window_set_events (GdkWindow *window,
return;
xevent_mask = StructureNotifyMask;
for (i = 0; i < nevent_masks; i++)
for (i = 0; i < gdk_nevent_masks; i++)
{
if (event_mask & (1 << (i + 1)))
xevent_mask |= event_mask_table[i];
xevent_mask |= gdk_event_mask_table[i];
}
XSelectInput (gdk_display, private->xwindow,
......
......@@ -54,6 +54,14 @@ gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;
gboolean gdk_xim_using; /* using XIM Protocol if TRUE */
GdkICPrivate *gdk_xim_ic; /* currently using IC */
GdkWindow *gdk_xim_window; /* currently using Widow */
GdkWindowPrivate *gdk_xgrab_window = NULL; /* Window that currently holds the
* x pointer grab
*/