Hack gdk_event_get_graphics_expose() to sort of work by adding an extra

Mon Jun  5 13:29:31 2000  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
	to sort of work by adding an extra return_exposes arg
	to gdk_event_translate() - it might be better to simply
	deprecate the function altogether and force people to rewrite
	without it. gdk_window_scroll() handles most of it, and where
	gdk_window_scroll() doesn't work, simply redrawing more does.

	* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
	assertion.

	* gtk-config.in: Include PANGO_CFLAGS/LIBS.

	* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
	bunch of pretty much useless /* Print debugging info */ comments
	which had drifted away from the code they were commenting.
This commit is contained in:
Owen Taylor
2000-06-05 15:24:59 +00:00
committed by Owen Taylor
parent f6b5d39189
commit eb34d19399
11 changed files with 168 additions and 58 deletions

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -1,3 +1,21 @@
Mon Jun 5 13:29:31 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c: Hack gdk_event_get_graphics_expose()
to sort of work by adding an extra return_exposes arg
to gdk_event_translate() - it might be better to simply
deprecate the function altogether and force people to rewrite
without it. gdk_window_scroll() handles most of it, and where
gdk_window_scroll() doesn't work, simply redrawing more does.
* gtk/gtkwidget.c (gtk_widget_set_default_direction): Fix up
assertion.
* gtk-config.in: Include PANGO_CFLAGS/LIBS.
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Remove a
bunch of pretty much useless /* Print debugging info */ comments
which had drifted away from the code they were commenting.
2000-06-02 Havoc Pennington <hp@pobox.com> 2000-06-02 Havoc Pennington <hp@pobox.com>
* gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer * gtk/testtextbuffer.c: Test program to make sure GtkTextBuffer

View File

@ -78,7 +78,8 @@ static gint gdk_event_apply_filters (XEvent *xevent,
GdkEvent *event, GdkEvent *event,
GList *filters); GList *filters);
static gint gdk_event_translate (GdkEvent *event, static gint gdk_event_translate (GdkEvent *event,
XEvent *xevent); XEvent *xevent,
gboolean return_exposes);
#if 0 #if 0
static Bool gdk_event_get_type (Display *display, static Bool gdk_event_get_type (Display *display,
XEvent *xevent, XEvent *xevent,
@ -207,7 +208,7 @@ gdk_event_get_graphics_expose (GdkWindow *window)
{ {
event = gdk_event_new (); event = gdk_event_new ();
if (gdk_event_translate (event, &xevent)) if (gdk_event_translate (event, &xevent, TRUE))
return event; return event;
else else
gdk_event_free (event); gdk_event_free (event);
@ -255,7 +256,8 @@ gdk_add_client_message_filter (GdkAtom message_type,
static gint static gint
gdk_event_translate (GdkEvent *event, gdk_event_translate (GdkEvent *event,
XEvent *xevent) XEvent *xevent,
gboolean return_exposes)
{ {
GdkWindow *window; GdkWindow *window;
@ -435,8 +437,6 @@ gdk_event_translate (GdkEvent *event,
else else
buf[charcount] = '\0'; buf[charcount] = '\0';
/* Print debugging info. */
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
if (gdk_debug_flags & GDK_DEBUG_EVENTS) if (gdk_debug_flags & GDK_DEBUG_EVENTS)
{ {
@ -474,8 +474,6 @@ gdk_event_translate (GdkEvent *event,
&keysym, &compose); &keysym, &compose);
event->key.keyval = keysym; event->key.keyval = keysym;
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("key release:\t\twindow: %ld key: %12s %d", g_message ("key release:\t\twindow: %ld key: %12s %d",
xevent->xkey.window, xevent->xkey.window,
@ -492,8 +490,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case ButtonPress: case ButtonPress:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d", g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window, xevent->xbutton.window,
@ -551,8 +547,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case ButtonRelease: case ButtonRelease:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("button release:\twindow: %ld x,y: %d %d button: %d", g_message ("button release:\twindow: %ld x,y: %d %d button: %d",
xevent->xbutton.window, xevent->xbutton.window,
@ -592,8 +586,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case MotionNotify: case MotionNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("motion notify:\t\twindow: %ld x,y: %d %d hint: %s", g_message ("motion notify:\t\twindow: %ld x,y: %d %d hint: %s",
xevent->xmotion.window, xevent->xmotion.window,
@ -626,8 +618,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case EnterNotify: case EnterNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("enter notify:\t\twindow: %ld detail: %d subwin: %ld", g_message ("enter notify:\t\twindow: %ld detail: %d subwin: %ld",
xevent->xcrossing.window, xevent->xcrossing.window,
@ -703,8 +693,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case LeaveNotify: case LeaveNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("leave notify:\t\twindow: %ld detail: %d subwin: %ld", g_message ("leave notify:\t\twindow: %ld detail: %d subwin: %ld",
xevent->xcrossing.window, xevent->xcrossing.window,
@ -781,8 +769,6 @@ gdk_event_translate (GdkEvent *event,
case NotifyAncestor: case NotifyAncestor:
case NotifyInferior: case NotifyInferior:
case NotifyNonlinear: case NotifyNonlinear:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("focus %s:\t\twindow: %ld", g_message ("focus %s:\t\twindow: %ld",
(xevent->xany.type == FocusIn) ? "in" : "out", (xevent->xany.type == FocusIn) ? "in" : "out",
@ -806,8 +792,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case KeymapNotify: case KeymapNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("keymap notify")); g_message ("keymap notify"));
@ -816,8 +800,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case Expose: case Expose:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s", g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s",
xevent->xexpose.window, xevent->xexpose.count, xevent->xexpose.window, xevent->xexpose.count,
@ -832,38 +814,58 @@ gdk_event_translate (GdkEvent *event,
expose_rect.width = xevent->xexpose.width; expose_rect.width = xevent->xexpose.width;
expose_rect.height = xevent->xexpose.height; expose_rect.height = xevent->xexpose.height;
_gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect); if (return_exposes)
{
event->expose.type = GDK_EXPOSE;
event->expose.area = expose_rect;
event->expose.window = window;
return_val = TRUE;
}
else
{
_gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect);
return_val = FALSE;
}
return_val = FALSE; return_val = FALSE;
} }
break; break;
case GraphicsExpose: case GraphicsExpose:
/* Print debugging info.
*/
{ {
GdkRectangle expose_rect; GdkRectangle expose_rect;
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("graphics expose:\tdrawable: %ld", g_message ("graphics expose:\tdrawable: %ld",
xevent->xgraphicsexpose.drawable)); xevent->xgraphicsexpose.drawable));
expose_rect.x = xevent->xgraphicsexpose.x + xoffset; expose_rect.x = xevent->xgraphicsexpose.x + xoffset;
expose_rect.y = xevent->xgraphicsexpose.y + yoffset; expose_rect.y = xevent->xgraphicsexpose.y + yoffset;
expose_rect.width = xevent->xgraphicsexpose.width; expose_rect.width = xevent->xgraphicsexpose.width;
expose_rect.height = xevent->xgraphicsexpose.height; expose_rect.height = xevent->xgraphicsexpose.height;
if (return_exposes)
{
event->expose.type = GDK_EXPOSE;
event->expose.area = expose_rect;
event->expose.window = window;
_gdk_window_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect); return_val = TRUE;
}
return_val = FALSE; else
{
_gdk_window_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect);
return_val = FALSE;
}
} }
break; break;
case NoExpose: case NoExpose:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("no expose:\t\tdrawable: %ld", g_message ("no expose:\t\tdrawable: %ld",
xevent->xnoexpose.drawable)); xevent->xnoexpose.drawable));
@ -874,8 +876,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case VisibilityNotify: case VisibilityNotify:
/* Print debugging info.
*/
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
if (gdk_debug_flags & GDK_DEBUG_EVENTS) if (gdk_debug_flags & GDK_DEBUG_EVENTS)
switch (xevent->xvisibility.state) switch (xevent->xvisibility.state)
@ -930,8 +930,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case DestroyNotify: case DestroyNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("destroy notify:\twindow: %ld", g_message ("destroy notify:\twindow: %ld",
xevent->xdestroywindow.window)); xevent->xdestroywindow.window));
@ -946,8 +944,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case UnmapNotify: case UnmapNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("unmap notify:\t\twindow: %ld", g_message ("unmap notify:\t\twindow: %ld",
xevent->xmap.window)); xevent->xmap.window));
@ -961,8 +957,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case MapNotify: case MapNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("map notify:\t\twindow: %ld", g_message ("map notify:\t\twindow: %ld",
xevent->xmap.window)); xevent->xmap.window));
@ -973,8 +967,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case ReparentNotify: case ReparentNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d", g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d",
xevent->xreparent.window, xevent->xreparent.window,
@ -988,8 +980,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case ConfigureNotify: case ConfigureNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s", g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s",
xevent->xconfigure.window, xevent->xconfigure.window,
@ -1060,8 +1050,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case PropertyNotify: case PropertyNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
gchar *atom = gdk_atom_name (xevent->xproperty.atom); gchar *atom = gdk_atom_name (xevent->xproperty.atom);
g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s", g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s",
@ -1124,8 +1112,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case ColormapNotify: case ColormapNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("colormap notify:\twindow: %ld", g_message ("colormap notify:\twindow: %ld",
xevent->xcolormap.window)); xevent->xcolormap.window));
@ -1139,8 +1125,6 @@ gdk_event_translate (GdkEvent *event,
GList *tmp_list; GList *tmp_list;
GdkFilterReturn result = GDK_FILTER_CONTINUE; GdkFilterReturn result = GDK_FILTER_CONTINUE;
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("client message:\twindow: %ld", g_message ("client message:\twindow: %ld",
xevent->xclient.window)); xevent->xclient.window));
@ -1180,8 +1164,6 @@ gdk_event_translate (GdkEvent *event,
break; break;
case MappingNotify: case MappingNotify:
/* Print debugging info.
*/
GDK_NOTE (EVENTS, GDK_NOTE (EVENTS,
g_message ("mapping notify")); g_message ("mapping notify"));
@ -1269,7 +1251,7 @@ gdk_event_get_type (Display *display,
GdkEvent event; GdkEvent event;
GdkPredicate *pred; GdkPredicate *pred;
if (gdk_event_translate (&event, xevent)) if (gdk_event_translate (&event, xevent, FALSE))
{ {
pred = (GdkPredicate*) arg; pred = (GdkPredicate*) arg;
return (* pred->func) (&event, pred->data); return (* pred->func) (&event, pred->data);
@ -1320,7 +1302,7 @@ gdk_events_queue (void)
gdk_event_queue_append (event); gdk_event_queue_append (event);
node = gdk_queued_tail; node = gdk_queued_tail;
if (gdk_event_translate (event, &xevent)) if (gdk_event_translate (event, &xevent, FALSE))
{ {
((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING; ((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING;
} }

View File

@ -99,7 +99,7 @@ if test "$echo_cflags" = "yes"; then
fi fi
done done
fi fi
echo -I@libdir@/gtk+/include $includes $glib_cflags @x_cflags@ echo -I@libdir@/gtk+/include $includes $glib_cflags @PANGO_CFLAGS@ @x_cflags@
fi fi
if test "$echo_libs" = "yes"; then if test "$echo_libs" = "yes"; then
@ -115,6 +115,6 @@ if test "$echo_libs" = "yes"; then
fi fi
done done
echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @x_libs@ @GDK_WLIBS@ @MATH_LIB@ echo $libdirs @x_ldflags@ -lgtk -lgdk $my_glib_libs @INTLLIBS@ @PANGO_LIBS@ @x_libs@ @GDK_WLIBS@ @MATH_LIB@
fi fi

View File

@ -5,11 +5,13 @@ Makefile.in
_libs _libs
.libs .libs
libgtk-1.1.la libgtk-1.1.la
testcalender
testgtk testgtk
testinput testinput
testrgb testrgb
testselection testselection
testtext testtext
testtextbuffer
simple simple
testtree testtree
gtkcompat.h gtkcompat.h

View File

@ -4026,12 +4026,12 @@ gtk_widget_get_direction (GtkWidget *widget)
* %GTK_TEXT_DIR_NONE. * %GTK_TEXT_DIR_NONE.
* *
* Set the default reading direction for widgets where the * Set the default reading direction for widgets where the
* direction has not been explicitely set by gtk_widget_set_direction(). * direction has not been explicitly set by gtk_widget_set_direction().
**/ **/
void void
gtk_widget_set_default_direction (GtkTextDirection dir) gtk_widget_set_default_direction (GtkTextDirection dir)
{ {
g_return_if_fail (dir == GTK_TEXT_DIR_RTL || GTK_TEXT_DIR_LTR); g_return_if_fail (dir == GTK_TEXT_DIR_RTL || dir == GTK_TEXT_DIR_LTR);
gtk_default_direction = dir; gtk_default_direction = dir;
} }