Commit 4389781e authored by Carsten Haitzler's avatar Carsten Haitzler
Browse files

Wheee now others can get to play :)



Wheee now others can get to play :)
parent 0da6bdc3
......@@ -6,10 +6,12 @@ SUBDIRS = $(SRC_SUBDIRS) docs
bin_SCRIPTS = gtk-config
EXTRA_DIST = \
gtk+.prj \
gtk+.spec \
gtk.m4 \
makecopyright \
TODO \
NEWS.pre-1-0 \
ChangeLog.pre-1-0 \
examples/aspectframe/Makefile \
examples/aspectframe/aspectframe.c \
examples/buttons/Makefile \
......
......@@ -18,25 +18,27 @@
/* Other stuff */
#undef HAVE_IPC_H
#undef HAVE_SHM_H
#undef HAVE_XPM
#undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H
/* some systems do not allow to ipcrm pages prior to
* actual usage, namely: OSF1 V3.2, SunOS 4.1.1, 5.5, 5.5.1, 5.6,
* IRIX 5.2 and 6.2.
*/
#undef IPC_RMID_DEFERRED_RELEASE
#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
#undef GTK_MAJOR_VERSION
#undef GTK_MINOR_VERSION
#undef GTK_MICRO_VERSION
#undef GTK_VERSION
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
......
......@@ -4,10 +4,35 @@ AC_INIT(gdk/gdktypes.h)
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
# Making releases:
# GTK_MICRO_VERSION += 1;
# GTK_INTERFACE_AGE += 1;
# GTK_BINARY_AGE += 1;
# if any functions have been added, set GTK_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
#
GTK_MAJOR_VERSION=1
GTK_MINOR_VERSION=0
GTK_MINOR_VERSION=1
GTK_MICRO_VERSION=0
GTK_INTERFACE_AGE=0
GTK_BINARY_AGE=0
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
AC_SUBST(GTK_MAJOR_VERSION)
AC_SUBST(GTK_MINOR_VERSION)
AC_SUBST(GTK_MICRO_VERSION)
AC_SUBST(GTK_VERSION)
# libtool versioning
LT_RELEASE=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION
LT_CURRENT=`expr $GTK_MICRO_VERSION - $GTK_INTERFACE_AGE`
LT_REVISION=$GTK_INTERFACE_AGE
LT_AGE=`expr $GTK_BINARY_AGE - $GTK_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
# For automake.
VERSION=$GTK_VERSION
......@@ -43,9 +68,10 @@ AC_ARG_ENABLE(xim, [ --enable-xim support XIM [default=yes]],
AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
AC_ARG_WITH(xinput, [ --with-xinput=[no/gxi/xfree] support XInput ])
AC_ARG_WITH(threads, [ --with-threads=[posix] support threading ])
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="-g"
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
else
if test "x$enable_debug" = "xno"; then
......@@ -80,15 +106,29 @@ if test "x$GCC" = "xyes"; then
fi
fi
AC_MSG_CHECKING([For extra flags to get ANSI library prototypes])
gtk_save_LDFLAGS=$LDFLAGS
LIBS="$LIBS -lm"
AC_TRY_RUN([#include <math.h>
int main (void) { return (log(1) != log(1.)); }],
AC_MSG_RESULT(none needed),
gtk_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -std1"
AC_TRY_RUN([#include <math.h>
int main (void) { return (log(1) != log(1.)); }],
AC_MSG_RESULT(-std1),
AC_MSG_RESULT()
CFLAGS=$gtk_save_CFLAGS
AC_MSG_WARN(
[No ANSI prototypes found in library. (-std1 didn't work.)])
)
)
LIBS=$gtk_save_LIBS
if test "x$enable_xim" = "xyes"; then
CFLAGS="$CFLAGS -DUSE_XIM"
fi
AC_DEFINE_UNQUOTED(GTK_MAJOR_VERSION, $GTK_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GTK_MINOR_VERSION, $GTK_MINOR_VERSION)
AC_DEFINE_UNQUOTED(GTK_MICRO_VERSION, $GTK_MICRO_VERSION)
AC_DEFINE_UNQUOTED(GTK_VERSION, "$GTK_VERSION")
# Find the X11 include and library directories
AC_PATH_X
AC_PATH_XTRA
......@@ -118,6 +158,16 @@ if test "x$enable_shm" = "xyes"; then
$x_libs)
fi
# Check for shaped window extension
AC_CHECK_LIB(Xext, XShapeCombineMask,
if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
$x_libs="-lXext $x_libs"
fi
AC_DEFINE(HAVE_SHAPE_EXT),
,
$x_libs)
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS"
......@@ -134,12 +184,20 @@ else
AC_DEFINE(XINPUT_NONE)
fi
# Threads
if test "x$with_threads" = "xposix" || test "x$with_threads" = "xyes"; then
AC_CHECK_LIB(pthread, pthread_create,
AC_DEFINE(USE_PTHREADS)
x_libs="$x_libs -lpthread"
CFLAGS="$CFLAGS -D_REENTRANT")
fi
AC_SUBST(x_cflags)
AC_SUBST(x_includes)
AC_SUBST(x_ldflags)
AC_SUBST(x_libs)
AC_SUBST(xinput_progs)
AC_SUBST(GTK_VERSION)
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
......@@ -265,5 +323,11 @@ if test $gtk_ok = no; then
AC_DEFINE(NO_FD_SET)
fi
AC_OUTPUT([Makefile gtk-config docs/Makefile gdk/Makefile gtk/Makefile],
[chmod +x gtk-config])
AC_OUTPUT([
Makefile
gtk-config
docs/Makefile
gdk/Makefile
gtk/Makefile
gtk/gtkfeatures.h
], [chmod +x gtk-config])
......@@ -2,9 +2,9 @@
gdkincludedir = $(includedir)/gdk
lib_LTLIBRARIES = libgdk.la
lib_LTLIBRARIES = libgdk-1.1.la
libgdk_la_SOURCES = \
libgdk_1_1_la_SOURCES = \
gdk.c \
gdkcc.c \
gdkcolor.c \
......@@ -26,6 +26,7 @@ libgdk_la_SOURCES = \
gdkrectangle.c \
gdkregion.c \
gdkselection.c \
gdkthreads.c \
gdkvisual.c \
gdkwindow.c \
gdkxid.c \
......@@ -46,7 +47,8 @@ gdkinclude_HEADERS = \
gdktypes.h \
gdkx.h
libgdk_la_LDFLAGS = -version-info 1:0:0 \
libgdk_1_1_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
@x_ldflags@ @x_libs@
INCLUDES = -I$(top_srcdir) -I../glib -I$(top_srcdir)/glib @x_cflags@
......@@ -78,5 +80,3 @@ files:
@files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
echo $$p; \
done
$(DEP_FILES) : $(BUILT_SOURCES)
......@@ -51,8 +51,8 @@
#include "gdkinput.h"
#ifdef USE_XIM
#include "gdkx.h"
#include "gdkkeysyms.h"
#endif
#include "gdkkeysyms.h"
#include "gdki18n.h"
#ifndef X_GETTIMEOFDAY
......@@ -625,7 +625,7 @@ gdk_exit (int errorcode)
*/
gchar*
gdk_set_locale ()
gdk_set_locale (void)
{
if (!setlocale (LC_ALL,""))
g_print ("locale not supported by C library\n");
......@@ -663,7 +663,7 @@ gdk_set_locale ()
*/
gint
gdk_events_pending ()
gdk_events_pending (void)
{
gint result;
GList *tmp_list;
......@@ -1023,13 +1023,13 @@ gdk_set_use_xshm (gint use_xshm)
}
gint
gdk_get_show_events ()
gdk_get_show_events (void)
{
return gdk_debug_flags & GDK_DEBUG_EVENTS;
}
gint
gdk_get_use_xshm ()
gdk_get_use_xshm (void)
{
return gdk_use_xshm;
}
......@@ -1055,7 +1055,7 @@ gdk_get_use_xshm ()
*/
guint32
gdk_time_get ()
gdk_time_get (void)
{
struct timeval end;
struct timeval elapsed;
......@@ -1094,7 +1094,7 @@ gdk_time_get ()
*/
guint32
gdk_timer_get ()
gdk_timer_get (void)
{
return timer_val;
}
......@@ -1129,13 +1129,13 @@ gdk_timer_set (guint32 milliseconds)
}
void
gdk_timer_enable ()
gdk_timer_enable (void)
{
timerp = &timer;
}
void
gdk_timer_disable ()
gdk_timer_disable (void)
{
timerp = NULL;
}
......@@ -1463,7 +1463,7 @@ gdk_keyboard_ungrab (guint32 time)
*/
gint
gdk_screen_width ()
gdk_screen_width (void)
{
gint return_val;
......@@ -1488,7 +1488,7 @@ gdk_screen_width ()
*/
gint
gdk_screen_height ()
gdk_screen_height (void)
{
gint return_val;
......@@ -1498,13 +1498,13 @@ gdk_screen_height ()
}
void
gdk_key_repeat_disable ()
gdk_key_repeat_disable (void)
{
XAutoRepeatOff (gdk_display);
}
void
gdk_key_repeat_restore ()
gdk_key_repeat_restore (void)
{
if (autorepeat)
XAutoRepeatOn (gdk_display);
......@@ -1531,14 +1531,14 @@ gdk_key_repeat_restore ()
*--------------------------------------------------------------
*/
void gdk_flush ()
void gdk_flush (void)
{
XSync (gdk_display, False);
}
void
gdk_beep ()
gdk_beep (void)
{
XBell(gdk_display, 100);
}
......@@ -1562,7 +1562,7 @@ gdk_beep ()
*/
static gint
gdk_event_wait ()
gdk_event_wait (void)
{
GList *list;
GdkInput *input;
......@@ -1606,8 +1606,31 @@ gdk_event_wait ()
max_input = MAX (max_input, input->source);
}
#ifdef USE_PTHREADS
if (gdk_using_threads)
{
gdk_select_waiting = TRUE;
FD_SET (gdk_threads_pipe[0], &readfds);
max_input = MAX (max_input, gdk_threads_pipe[0]);
gdk_threads_leave ();
}
#endif
nfd = select (max_input+1, &readfds, &writefds, &exceptfds, timerp);
#ifdef USE_PTHREADS
if (gdk_using_threads)
{
gchar c;
gdk_threads_enter ();
gdk_select_waiting = FALSE;
if (FD_ISSET (gdk_threads_pipe[0], &readfds))
read (gdk_threads_pipe[0], &c, 1);
}
#endif
timerp = NULL;
timer_val = 0;
......@@ -1685,7 +1708,8 @@ gdk_event_translate (GdkEvent *event,
GdkWindow *window;
GdkWindowPrivate *window_private;
XComposeStatus compose;
static XComposeStatus compose;
KeySym keysym;
int charcount;
#ifdef USE_XIM
static gchar* buf = NULL;
......@@ -1767,16 +1791,16 @@ gdk_event_translate (GdkEvent *event,
buf_len = 128;
buf = g_new (gchar, buf_len);
}
keysym = GDK_VoidSymbol;
if (xim_using == TRUE && xim_ic)
{
Status status;
/* Clear keyval. Depending on status, may not be set */
event->key.keyval = GDK_VoidSymbol;
charcount = XmbLookupString(xim_ic->xic,
&xevent->xkey, buf, buf_len-1,
(KeySym*) &event->key.keyval,
&status);
&keysym, &status);
if (status == XBufferOverflow)
{ /* retry */
/* alloc adequate size of buffer */
......@@ -1789,8 +1813,7 @@ gdk_event_translate (GdkEvent *event,
charcount = XmbLookupString (xim_ic->xic,
&xevent->xkey, buf, buf_len-1,
(KeySym*) &event->key.keyval,
&status);
&keysym, &status);
}
if (status == XLookupNone)
{
......@@ -1800,13 +1823,13 @@ gdk_event_translate (GdkEvent *event,
}
else
charcount = XLookupString (&xevent->xkey, buf, buf_len,
(KeySym*) &event->key.keyval,
&compose);
&keysym, &compose);
#else
charcount = XLookupString (&xevent->xkey, buf, 16,
(KeySym*) &event->key.keyval,
&compose);
&keysym, &compose);
#endif
event->key.keyval = keysym;
if (charcount > 0 && buf[charcount-1] == '\0')
charcount --;
else
......@@ -1844,9 +1867,10 @@ gdk_event_translate (GdkEvent *event,
case KeyRelease:
/* Lookup the string corresponding to the given keysym.
*/
keysym = GDK_VoidSymbol;
charcount = XLookupString (&xevent->xkey, buf, 16,
(KeySym*) &event->key.keyval,
&compose);
&keysym, &compose);
event->key.keyval = keysym;
/* Print debugging info.
*/
......@@ -1964,7 +1988,7 @@ gdk_event_translate (GdkEvent *event,
window_private->dnd_drag_savedeventmask = dnd_winattr.your_event_mask;
dnd_setwinattr.event_mask =
window_private->dnd_drag_eventmask = ButtonMotionMask | ButtonPressMask | ButtonReleaseMask |
EnterWindowMask | LeaveWindowMask;
EnterWindowMask | LeaveWindowMask | ExposureMask;
XChangeWindowAttributes(gdk_display, window_private->xwindow,
CWEventMask, &dnd_setwinattr);
}
......@@ -2333,7 +2357,7 @@ gdk_event_translate (GdkEvent *event,
ButtonMotionMask | PointerMotionMask |
/* PointerMotionHintMask | */ /* HINTME */
ButtonPressMask | ButtonReleaseMask,
GrabModeAsync, GrabModeAsync, gdk_root_window,
GrabModeAsync, GrabModeAsync, None,
None, CurrentTime);
#ifdef G_ENABLE_DEBUG
GDK_NOTE(DND, g_print("xgpret = %d\n", xgpret));
......@@ -3028,7 +3052,7 @@ gdk_synthesize_click (GdkEvent *event,
*/
static void
gdk_exit_func ()
gdk_exit_func (void)
{
static gboolean in_gdk_exit_func = FALSE;
......@@ -4004,8 +4028,8 @@ gdk_dnd_check_types (GdkWindow *window,
if (realfmt != (sizeof(Atom) * 8))
{
g_warning("XdeTypelist property had format of %d instead of the expected %d, on window %#lx\n",
realfmt, sizeof(Atom) * 8, xevent->xclient.data.l[0]);
g_warning("XdeTypelist property had format of %d instead of the expected %ld, on window %#lx\n",
realfmt, (glong)sizeof(Atom) * 8, xevent->xclient.data.l[0]);
return 0;
}
......
......@@ -299,6 +299,8 @@ void gdk_window_set_decorations (GdkWindow *window,
GdkWMDecoration decorations);
void gdk_window_set_functions (GdkWindow *window,
GdkWMFunction functions);
GList * gdk_window_get_toplevels (void);
/* Cursors
*/
......@@ -358,6 +360,10 @@ void gdk_gc_set_line_attributes (GdkGC *gc,
GdkLineStyle line_style,
GdkCapStyle cap_style,
GdkJoinStyle join_style);
void gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gchar dash_list[],
gint n);
void gdk_gc_copy (GdkGC *dst_gc,
GdkGC *src_gc);
......@@ -795,6 +801,14 @@ GdkRegion* gdk_regions_subtract (GdkRegion *source1,
GdkRegion* gdk_regions_xor (GdkRegion *source1,
GdkRegion *source2);
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);
#ifdef __cplusplus
}
......
......@@ -60,11 +60,11 @@ gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
gdk_window_ref(default_pixmapwin);
gdk_dnd.c->drag_pm_default = default_pixmapwin;
gdk_dnd.c->default_hotspot = *default_hotspot;
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, (gpointer)(glong)((GdkWindowPrivate *)default_pixmapwin)->xwindow);
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, GUINT_TO_POINTER (((GdkWindowPrivate *)default_pixmapwin)->xwindow));
if(goahead_pixmapwin)
{
gdk_window_ref(goahead_pixmapwin);
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, (gpointer)(glong)((GdkWindowPrivate *)goahead_pixmapwin)->xwindow);
gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, GUINT_TO_POINTER (((GdkWindowPrivate *)goahead_pixmapwin)->xwindow));
gdk_dnd.c->drag_pm_ok = goahead_pixmapwin;
gdk_dnd.c->ok_hotspot = *goahead_hotspot;
}
......
......@@ -88,6 +88,18 @@ gdk_gc_new_with_values (GdkWindow *window,
case GDK_XOR:
xvalues.function = GXxor;
break;
case GDK_OR:
xvalues.function = GXor;
break;
case GDK_AND:
xvalues.function = GXand;
break;
case GDK_NOR:
xvalues.function = GXnor;
break;
case GDK_NAND:
xvalues.function = GXnand;
break;
}
xvalues_mask |= GCFunction;
}
......@@ -702,6 +714,22 @@ gdk_gc_set_line_attributes (GdkGC *gc,
xline_style, xcap_style, xjoin_style);
}
void
gdk_gc_set_dashes (GdkGC *gc,
gint dash_offset,
gchar dash_list[],
gint n)
{
GdkGCPrivate *private;
g_return_if_fail (gc != NULL);
g_return_if_fail (dash_list != NULL);
private = (GdkGCPrivate*) gc;
XSetDashes (private->xdisplay, private->xgc, dash_offset, dash_list, n);
}
void
gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
{
......
......@@ -20,6 +20,7 @@
#include <X11/Xlib.h>
#include "gdktypes.h"
#include "gdkprivate.h"
#include "../config.h"
guint gdk_debug_flags = 0;
gint gdk_use_xshm = TRUE;
......@@ -53,3 +54,13 @@ gint gdk_error_code;
gint gdk_error_warnings = TRUE;
gint gdk_null_window_warnings = TRUE;
GList *gdk_default_filters = NULL;
gboolean gdk_using_threads = FALSE;
/* Used to signal the mainloop thread from its select() */
#ifdef USE_PTHREADS
gint gdk_threads_pipe[2];
gboolean gdk_select_waiting = FALSE;
#endif
......@@ -64,7 +64,7 @@ static GList *image_list = NULL;
void
gdk_image_exit ()
gdk_image_exit (void)
{
GdkImage *image;
......@@ -131,7 +131,7 @@ gdk_image_check_xshm(Display *display)
}
void
gdk_image_init ()
gdk_image_init (void)
{
if (gdk_use_xshm)
{
......
......@@ -70,7 +70,7 @@ static GList *gdk_input_windows;
#include "gdkinputgxi.h"
GList *
gdk_input_list_devices ()
gdk_input_list_devices (void)
{
return gdk_input_devices;
}
......
......@@ -29,7 +29,7 @@ static void gdk_input_none_get_pointer (GdkWindow *window,
GdkModifierType *mask);
void
gdk_input_init ()
gdk_input_init (void)
{
gdk_input_vtable.set_mode = NULL;
gdk_input_vtable.set_axes = NULL;
......
......@@ -22,7 +22,7 @@
/* forward declarations */
static gint gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode);
static void gdk_input_check_proximity();
static void gdk_input_check_proximity (void);
static void gdk_input_xfree_configure_event (XConfigureEvent *xevent,
GdkWindow *window);
static void gdk_input_xfree_enter_event (XCrossingEvent *xevent,
......@@ -115,7 +115,7 @@ gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode)
}
static void
gdk_input_check_proximity()