Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikita Churaev
gtk
Commits
d5d01a5a
Commit
d5d01a5a
authored
Dec 18, 1997
by
Owen Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
It's all in the changelog. Well, almost all.
-owt
parent
65e63db0
Changes
74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
3900 additions
and
1412 deletions
+3900
-1412
Makefile.am
Makefile.am
+1
-1
Makefile.in
Makefile.in
+2
-2
configure
configure
+146
-192
configure.in
configure.in
+22
-31
gdk/gdk.c
gdk/gdk.c
+271
-140
gdk/gdk.h
gdk/gdk.h
+25
-15
gdk/gdkcolor.c
gdk/gdkcolor.c
+2
-7
gdk/gdkfont.c
gdk/gdkfont.c
+21
-26
gdk/gdkgc.c
gdk/gdkgc.c
+6
-4
gdk/gdki18n.h
gdk/gdki18n.h
+13
-16
gdk/gdkinput.c
gdk/gdkinput.c
+11
-1
gdk/gdkinput.h
gdk/gdkinput.h
+11
-2
gdk/gdkinputcommon.h
gdk/gdkinputcommon.h
+156
-18
gdk/gdkinputgxi.h
gdk/gdkinputgxi.h
+2
-1
gdk/gdkinputnone.h
gdk/gdkinputnone.h
+1
-0
gdk/gdkinputxfree.h
gdk/gdkinputxfree.h
+21
-47
gdk/gdkpixmap.c
gdk/gdkpixmap.c
+28
-11
gdk/gdkprivate.h
gdk/gdkprivate.h
+9
-1
gdk/gdktypes.h
gdk/gdktypes.h
+24
-3
gdk/gdkwindow.c
gdk/gdkwindow.c
+105
-34
gdk/gdkxid.c
gdk/gdkxid.c
+1
-1
gdk/gxid_lib.c
gdk/gxid_lib.c
+11
-2
gdk/x11/gdkcolor-x11.c
gdk/x11/gdkcolor-x11.c
+2
-7
gdk/x11/gdkfont-x11.c
gdk/x11/gdkfont-x11.c
+21
-26
gdk/x11/gdkinput-gxi.c
gdk/x11/gdkinput-gxi.c
+2
-1
gdk/x11/gdkinput-none.c
gdk/x11/gdkinput-none.c
+1
-0
gdk/x11/gdkinput-x11.c
gdk/x11/gdkinput-x11.c
+156
-18
gdk/x11/gdkinput-xfree.c
gdk/x11/gdkinput-xfree.c
+21
-47
gdk/x11/gdkinput.c
gdk/x11/gdkinput.c
+11
-1
gdk/x11/gdkmain-x11.c
gdk/x11/gdkmain-x11.c
+271
-140
gdk/x11/gdkpixmap-x11.c
gdk/x11/gdkpixmap-x11.c
+28
-11
gdk/x11/gdkwindow-x11.c
gdk/x11/gdkwindow-x11.c
+105
-34
gdk/x11/gdkxid.c
gdk/x11/gdkxid.c
+1
-1
gdk/x11/gxid_lib.c
gdk/x11/gxid_lib.c
+11
-2
glib/configure
glib/configure
+10
-34
glib/configure.in
glib/configure.in
+6
-9
glib/glibconfig.h.in
glib/glibconfig.h.in
+0
-1
gtk/gtk.defs
gtk/gtk.defs
+1240
-188
gtk/gtkaccelerator.c
gtk/gtkaccelerator.c
+6
-13
gtk/gtkaccelerator.h
gtk/gtkaccelerator.h
+0
-1
gtk/gtkcurve.c
gtk/gtkcurve.c
+2
-2
gtk/gtkgamma.c
gtk/gtkgamma.c
+2
-2
gtk/gtkhscrollbar.c
gtk/gtkhscrollbar.c
+2
-0
gtk/gtkinputdialog.c
gtk/gtkinputdialog.c
+195
-32
gtk/gtkinputdialog.h
gtk/gtkinputdialog.h
+3
-0
gtk/gtkmain.c
gtk/gtkmain.c
+117
-39
gtk/gtkmain.h
gtk/gtkmain.h
+1
-1
gtk/gtkmenu.c
gtk/gtkmenu.c
+8
-6
gtk/gtkmenufactory.c
gtk/gtkmenufactory.c
+7
-13
gtk/gtkmenuitem.c
gtk/gtkmenuitem.c
+12
-11
gtk/gtkobject.c
gtk/gtkobject.c
+1
-1
gtk/gtkpixmap.c
gtk/gtkpixmap.c
+41
-14
gtk/gtkprogressbar.c
gtk/gtkprogressbar.c
+1
-1
gtk/gtkrange.c
gtk/gtkrange.c
+25
-20
gtk/gtkrc.c
gtk/gtkrc.c
+2
-2
gtk/gtkruler.c
gtk/gtkruler.c
+2
-2
gtk/gtksignal.c
gtk/gtksignal.c
+4
-10
gtk/gtkstyle.c
gtk/gtkstyle.c
+10
-15
gtk/gtktext.c
gtk/gtktext.c
+34
-0
gtk/gtktooltips.c
gtk/gtktooltips.c
+10
-21
gtk/gtktooltips.h
gtk/gtktooltips.h
+0
-3
gtk/gtktypebuiltins.c
gtk/gtktypebuiltins.c
+6
-0
gtk/gtktypebuiltins.h
gtk/gtktypebuiltins.h
+38
-32
gtk/gtkviewport.c
gtk/gtkviewport.c
+36
-28
gtk/gtkvscrollbar.c
gtk/gtkvscrollbar.c
+2
-0
gtk/gtkwidget.c
gtk/gtkwidget.c
+68
-28
gtk/gtkwindow.c
gtk/gtkwindow.c
+74
-34
gtk/gtkwindow.h
gtk/gtkwindow.h
+2
-0
gtk/testgtk.c
gtk/testgtk.c
+189
-0
gtk/testinput.c
gtk/testinput.c
+17
-3
gtk/testselection.c
gtk/testselection.c
+1
-0
tests/testgtk.c
tests/testgtk.c
+189
-0
tests/testinput.c
tests/testinput.c
+17
-3
tests/testselection.c
tests/testselection.c
+1
-0
No files found.
Makefile.am
View file @
d5d01a5a
...
...
@@ -3,7 +3,7 @@
SRC_SUBDIRS
=
glib gdk gtk
SUBDIRS
=
$(SRC_SUBDIRS)
docs
EXTRA_DIST
=
gtk+.prj makecopyright TODO
EXTRA_DIST
=
gtk+.prj makecopyright TODO
REFCOUNTING
.PHONY
:
files populate checkin release
...
...
Makefile.in
View file @
d5d01a5a
...
...
@@ -75,7 +75,7 @@ xinput_progs = @xinput_progs@
SRC_SUBDIRS
=
glib gdk gtk
SUBDIRS
=
$(SRC_SUBDIRS)
docs
EXTRA_DIST
=
gtk+.prj makecopyright TODO
EXTRA_DIST
=
gtk+.prj makecopyright TODO
REFCOUNTING
ACLOCAL_M4
=
$(top_srcdir)
/aclocal.m4
mkinstalldirs
=
$(SHELL)
$(top_srcdir)
/mkinstalldirs
CONFIG_HEADER
=
config.h
...
...
@@ -88,7 +88,7 @@ ltmain.sh missing mkinstalldirs stamp-h.in
DISTFILES
=
$(DIST_COMMON)
$(SOURCES)
$(HEADERS)
$(TEXINFOS)
$(EXTRA_DIST)
TAR
=
g
tar
TAR
=
tar
GZIP
=
--best
default
:
all
...
...
configure
View file @
d5d01a5a
This diff is collapsed.
Click to expand it.
configure.in
View file @
d5d01a5a
# Process this file with autoconf to produce a configure script.
AC_INIT(gdk/gdktypes.h)
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
GTK_MAJOR_VERSION=0
GTK_MINOR_VERSION=99
GTK_MICRO_VERSION=0
...
...
@@ -13,6 +16,9 @@ PACKAGE=gtk+
# Configure glib
AC_CONFIG_SUBDIRS(glib)
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
...
...
@@ -42,7 +48,7 @@ AC_ARG_WITH(locale, [ --with-locale=LOCALE locale name you want to use ])
AC_ARG_WITH(xinput, [ --with-xinput[=no/gxi/xfree] support XInput ])
if test -n "$DEBUGFLAG"; then
test "$
{CFLAGS+set}
" = set || CFLAGS="$DEBUGFLAG"
test "$
cflags_set
" = set || CFLAGS="$DEBUGFLAG"
else
CFLAGS="$CFLAGS -DNDEBUG"
fi
...
...
@@ -104,7 +110,7 @@ x_ldflags="$X_LDFLAGS $X_LIBS"
# set up things for XInput
if test "x$with_xinput" = "xgxi
-o
x$with_xinput" = "xyes"; then
if test "x$with_xinput" = "xgxi
" -o "
x$with_xinput" = "xyes"; then
AC_DEFINE(XINPUT_GXI)
xinput_progs=gxid
x_libs="-lXi $x_libs"
...
...
@@ -199,38 +205,23 @@ 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)
# Look for wide string functions in wchar.h or wcstr.h
AC_MSG_CHECKING(for <wchar.h> or <wcstr.h>)
AC_TRY_CPP([#include <wchar.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = no; then
AC_TRY_CPP([#include <wcstr.h>], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = no; then
need_x_locale=yes
fi
fi
AC_MSG_RESULT($gtk_ok)
# Check if X_LOCALE definition is necessary
AC_MSG_CHECKING(need -DX_LOCALE)
if test x$need_x_locale = xyes; then
AC_MSG_RESULT([yes (C library doesn't include wide string functions)])
else
AC_TRY_RUN([
#include <stdio.h>
#include <locale.h>
int
main ()
{
return setlocale (LC_ALL, "${with_locale}") == NULL;
}],
need_x_locale=no,
need_x_locale=yes)
AC_MSG_RESULT($need_x_locale)
fi
AC_TRY_RUN([
#include <stdio.h>
#include <locale.h>
int
main ()
{
return setlocale (LC_ALL, "${with_locale}") == NULL;
}],
need_x_locale=no,
need_x_locale=yes)
AC_MSG_RESULT($need_x_locale)
if test $need_x_locale = yes; then
CFLAGS="$CFLAGS -DX_LOCALE"
fi
...
...
gdk/gdk.c
View file @
d5d01a5a
...
...
@@ -88,6 +88,7 @@ struct _GdkInput
GdkInputCondition
condition
;
GdkInputFunction
function
;
gpointer
data
;
GdkDestroyNotify
destroy
;
};
struct
_GdkPredicate
...
...
@@ -99,12 +100,19 @@ struct _GdkPredicate
/*
* Private function declarations
*/
static
GdkEvent
*
gdk_event_new
(
void
);
static
gint
gdk_event_wait
(
void
);
static
gint
gdk_event_apply_filters
(
XEvent
*
xevent
,
GdkEvent
*
event
,
GList
*
filters
);
static
gint
gdk_event_translate
(
GdkEvent
*
event
,
XEvent
*
xevent
);
#if 0
static Bool gdk_event_get_type (Display *display,
XEvent *xevent,
XPointer arg);
#endif
static
void
gdk_synthesize_click
(
GdkEvent
*
event
,
gint
nclicks
);
...
...
@@ -157,15 +165,6 @@ static int connection_number = 0; /* The file descriptor numbe
* the "select" system call.
*/
static
gint
received_destroy_notify
=
FALSE
;
/* Did we just receive a destroy notify
* event? If so, we need to actually
* destroy the window which received
* it now.
*/
static
GdkWindow
*
window_to_destroy
=
NULL
;
/* If we previously received a destroy
* notify event then this is the window
* which received that event.
*/
static
struct
timeval
start
;
/* The time at which the library was
* last initialized.
...
...
@@ -601,6 +600,58 @@ gdk_events_pending ()
return
XPending
(
gdk_display
);
}
/*
*--------------------------------------------------------------
* gdk_event_get_graphics_expose
*
* Waits for a GraphicsExpose or NoExpose event
*
* Arguments:
*
* Results:
* For GraphicsExpose events, returns a pointer to the event
* converted into a GdkEvent Otherwise, returns NULL.
*
* Side effects:
*
*-------------------------------------------------------------- */
static
Bool
graphics_expose_predicate
(
Display
*
display
,
XEvent
*
xevent
,
XPointer
arg
)
{
GdkWindowPrivate
*
private
=
(
GdkWindowPrivate
*
)
arg
;
if
((
xevent
->
xany
.
window
==
private
->
xwindow
)
&&
((
xevent
->
xany
.
type
==
GraphicsExpose
)
||
(
xevent
->
xany
.
type
==
NoExpose
)))
return
True
;
else
return
False
;
}
GdkEvent
*
gdk_event_get_graphics_expose
(
GdkWindow
*
window
)
{
XEvent
xevent
;
GdkEvent
*
event
;
XIfEvent
(
gdk_display
,
&
xevent
,
graphics_expose_predicate
,
(
XPointer
)
window
);
if
(
xevent
.
xany
.
type
==
GraphicsExpose
)
{
event
=
gdk_event_new
();
if
(
gdk_event_translate
(
event
,
&
xevent
))
return
event
;
else
gdk_event_free
(
event
);
}
return
NULL
;
}
/*
*--------------------------------------------------------------
* gdk_event_get
...
...
@@ -608,14 +659,11 @@ gdk_events_pending ()
* Gets the next event.
*
* Arguments:
* "event" is used to hold the received event.
* If "event" is NULL an event is received as normal
* however it is not placed in "event" (and thus no
* error occurs).
*
* Results:
* Returns TRUE if an event was received that we care about
* and FALSE otherwise. This function will also return
* If an event was received that we care about, returns
* a pointer to that event, to be freed with gdk_event_free.
* Otherwise, returns NULL. This function will also return
* before an event is received if the timeout interval
* runs out.
*
...
...
@@ -624,45 +672,14 @@ gdk_events_pending ()
*--------------------------------------------------------------
*/
gint
gdk_event_get
(
GdkEvent
*
event
,
GdkEventFunc
pred
,
gpointer
data
)
GdkEvent
*
gdk_event_get
(
void
)
{
GdkEvent
*
temp_event
;
GdkPredicate
event_pred
;
GdkEvent
*
event
;
GList
*
temp_list
;
XEvent
xevent
;
/* If the last event we received was a destroy notify
* event then we will actually destroy the "gdk" data
* structures now. We don't want to destroy them at the
* time of receiving the event since the main program
* may try to access them and may need to destroy user
* data that has been attached to the window
*/
if
(
received_destroy_notify
)
{
if
(
gdk_show_events
)
g_print
(
"destroying window:
\t
window: %ld
\n
"
,
((
GdkWindowPrivate
*
)
window_to_destroy
)
->
xwindow
-
base_id
);
gdk_window_real_destroy
(
window_to_destroy
);
received_destroy_notify
=
FALSE
;
window_to_destroy
=
NULL
;
}
/* Initially we haven't received an event and want to
* return FALSE. If "event" is non-NULL, then initialize
* it to the nothing event.
*/
if
(
event
)
{
event
->
any
.
type
=
GDK_NOTHING
;
event
->
any
.
window
=
NULL
;
event
->
any
.
send_event
=
FALSE
;
}
#if 0
if (pred)
{
temp_list = putback_events;
...
...
@@ -685,65 +702,61 @@ gdk_event_get (GdkEvent *event,
event_pred.func = pred;
event_pred.data = data;
if
(
XCheckIfEvent
(
gdk_display
,
&
xevent
,
gdk_event_get_type
,
(
XPointer
)
&
event_pred
))
if (XCheckIfEvent (gdk_display, &xevent, gdk_event_get_type, (XPointer) &
event_pred))
if (event)
return gdk_event_translate (event, &xevent);
}
else
#endif
if
(
putback_events
)
{
if
(
putback_events
)
{
temp_event
=
putback_events
->
data
;
*
event
=
*
temp_event
;
temp_list
=
putback_events
;
putback_events
=
putback_events
->
next
;
if
(
putback_events
)
putback_events
->
prev
=
NULL
;
temp_list
->
next
=
NULL
;
temp_list
->
prev
=
NULL
;
g_list_free
(
temp_list
);
g_free
(
temp_event
);
return
TRUE
;
}
/* Wait for an event to occur or the timeout to elapse.
* If an event occurs "gdk_event_wait" will return TRUE.
* If the timeout elapses "gdk_event_wait" will return
* FALSE.
event
=
putback_events
->
data
;
temp_list
=
putback_events
;
putback_events
=
g_list_remove_link
(
putback_events
,
temp_list
);
g_list_free_1
(
temp_list
);
return
event
;
}
/* Wait for an event to occur or the timeout to elapse.
* If an event occurs "gdk_event_wait" will return TRUE.
* If the timeout elapses "gdk_event_wait" will return
* FALSE.
*/
if
(
gdk_event_wait
())
{
/* If we get here we can rest assurred that an event
* has occurred. Read it.
*/
if
(
gdk_event_wait
())
{
/* If we get here we can rest assurred that an event
* has occurred. Read it.
*/
#ifdef USE_XIM
gint
filter_status
;
if
(
xim_using
&&
xim_window
)
do
{
/* dont dispatch events used by IM */
XNextEvent
(
gdk_display
,
&
xevent
);
filter_status
=
XFilterEvent
(
&
xevent
,
GDK_WINDOW_XWINDOW
(
xim_window
));
}
while
(
filter_status
==
True
);
else
gint
filter_status
;
if
(
xim_using
&&
xim_window
)
do
{
/* don't dispatch events used by IM */
XNextEvent
(
gdk_display
,
&
xevent
);
filter_status
=
XFilterEvent
(
&
xevent
,
GDK_WINDOW_XWINDOW
(
xim_window
));
}
while
(
filter_status
==
True
);
else
XNextEvent
(
gdk_display
,
&
xevent
);
#else
XNextEvent
(
gdk_display
,
&
xevent
);
XNextEvent
(
gdk_display
,
&
xevent
);
#endif
event
=
gdk_event_new
();
event
->
any
.
send_event
=
xevent
.
xany
.
send_event
;
/* If "event" non-NULL.
*/
if
(
event
)
return
gdk_event_translate
(
event
,
&
xevent
);
}
event
->
any
.
type
=
GDK_NOTHING
;
event
->
any
.
window
=
NULL
;
event
->
any
.
send_event
=
FALSE
;
event
->
any
.
send_event
=
xevent
.
xany
.
send_event
;
if
(
gdk_event_translate
(
event
,
&
xevent
))
return
event
;
else
gdk_event_free
(
event
);
}
return
FALSE
;
return
NULL
;
}
void
...
...
@@ -753,8 +766,7 @@ gdk_event_put (GdkEvent *event)
g_return_if_fail
(
event
!=
NULL
);
new_event
=
g_new
(
GdkEvent
,
1
);
*
new_event
=
*
event
;
new_event
=
gdk_event_copy
(
event
);
putback_events
=
g_list_prepend
(
putback_events
,
new_event
);
}
...
...
@@ -779,13 +791,11 @@ gdk_event_put (GdkEvent *event)
static
GMemChunk
*
event_chunk
;
GdkEvent
*
gdk_event_
copy
(
GdkEvent
*
event
)
static
GdkEvent
*
gdk_event_
new
(
void
)
{
GdkEvent
*
new_event
;
g_return_val_if_fail
(
event
!=
NULL
,
NULL
);
if
(
event_chunk
==
NULL
)
event_chunk
=
g_mem_chunk_new
(
"events"
,
sizeof
(
GdkEvent
),
...
...
@@ -793,8 +803,31 @@ gdk_event_copy (GdkEvent *event)
G_ALLOC_AND_FREE
);
new_event
=
g_chunk_new
(
GdkEvent
,
event_chunk
);
return
new_event
;
}
GdkEvent
*
gdk_event_copy
(
GdkEvent
*
event
)
{
GdkEvent
*
new_event
;
g_return_val_if_fail
(
event
!=
NULL
,
NULL
);
new_event
=
gdk_event_new
();
*
new_event
=
*
event
;
gdk_window_ref
(
new_event
->
any
.
window
);
if
((
event
->
any
.
type
==
GDK_KEY_PRESS
)
||
(
event
->
any
.
type
==
GDK_KEY_RELEASE
))
new_event
->
key
.
string
=
g_strdup
(
event
->
key
.
string
);
if
(((
event
->
any
.
type
==
GDK_ENTER_NOTIFY
)
||
(
event
->
any
.
type
==
GDK_LEAVE_NOTIFY
))
&&
(
event
->
crossing
.
subwindow
!=
NULL
))
gdk_window_ref
(
event
->
crossing
.
subwindow
);
return
new_event
;
}
...
...
@@ -822,7 +855,18 @@ gdk_event_free (GdkEvent *event)
g_assert
(
event_chunk
!=
NULL
);
g_return_if_fail
(
event
!=
NULL
);
gdk_window_unref
(
event
->
any
.
window
);
if
((
event
->
any
.
type
==
GDK_KEY_PRESS
)
||
(
event
->
any
.
type
==
GDK_KEY_RELEASE
))
g_free
(
event
->
key
.
string
);
if
(
event
->
any
.
window
)
gdk_window_unref
(
event
->
any
.
window
);
if
(((
event
->
any
.
type
==
GDK_ENTER_NOTIFY
)
||
(
event
->
any
.
type
==
GDK_LEAVE_NOTIFY
))
&&
(
event
->
crossing
.
subwindow
!=
NULL
))
gdk_window_unref
(
event
->
crossing
.
subwindow
);
g_mem_chunk_free
(
event_chunk
,
event
);
}
...
...
@@ -1008,10 +1052,11 @@ gdk_timer_disable ()
}
gint
gdk_input_add
(
gint
source
,
GdkInputCondition
condition
,
GdkInputFunction
function
,
gpointer
data
)
gdk_input_add_interp
(
gint
source
,
GdkInputCondition
condition
,
GdkInputFunction
function
,
gpointer
data
,
GdkDestroyNotify
destroy
)
{
static
gint
next_tag
=
1
;
GList
*
list
;
...
...
@@ -1028,8 +1073,11 @@ gdk_input_add (gint source,
if
((
input
->
source
==
source
)
&&
(
input
->
condition
==
condition
))
{
if
(
input
->
destroy
)
(
input
->
destroy
)
(
input
->
data
);
input
->
function
=
function
;
input
->
data
=
data
;
input
->
destroy
=
destroy
;
tag
=
input
->
tag
;
}
}
...
...
@@ -1042,6 +1090,7 @@ gdk_input_add (gint source,
input
->
condition
=
condition
;
input
->
function
=
function
;
input
->
data
=
data
;
input
->
destroy
=
destroy
;
tag
=
input
->
tag
;
inputs
=
g_list_prepend
(
inputs
,
input
);
...
...
@@ -1050,6 +1099,15 @@ gdk_input_add (gint source,
return
tag
;
}
gint
gdk_input_add
(
gint
source
,
GdkInputCondition
condition
,
GdkInputFunction
function
,
gpointer
data
)
{
return
gdk_input_add_interp
(
source
,
condition
,
function
,
data
,
NULL
);
}
void
gdk_input_remove
(
gint
tag
)
{
...
...
@@ -1064,6 +1122,9 @@ gdk_input_remove (gint tag)
if
(
input
->
tag
==
tag
)
{
if
(
input
->
destroy
)
(
input
->
destroy
)
(
input
->
data
);
temp_list
=
list
;
if
(
list
->
next
)
...
...
@@ -1470,6 +1531,31 @@ gdk_event_wait ()
return
FALSE
;
}
static
gint
gdk_event_apply_filters
(
XEvent
*
xevent
,
GdkEvent
*
event
,
GList
*
filters
)
{
GdkEventFilter
*
filter
;
GList
*
tmp_list
;
GdkFilterReturn
result
;
tmp_list
=
filters
;
while
(
tmp_list
)
{
filter
=
(
GdkEventFilter
*
)
tmp_list
->
data
;
result
=
(
*
filter
->
function
)(
xevent
,
event
,
filter
->
data
);
if
(
result
!=
GDK_FILTER_CONTINUE
)
return
result
;
tmp_list
=
tmp_list
->
next
;
}
return
GDK_FILTER_CONTINUE
;
}
static
gint
gdk_event_translate
(
GdkEvent
*
event
,
XEvent
*
xevent
)
...
...
@@ -1520,6 +1606,25 @@ gdk_event_translate (GdkEvent *event,
window
=
gdk_window_lookup
(
xevent
->
xany
.
window
);
window_private
=
(
GdkWindowPrivate
*
)
window
;
if
(
window
==
NULL
)
g_warning
(
"%#lx -> NULL
\n
"
,
xevent
->
xany
.
window
);
else
gdk_window_ref
(
window
);
/* Check for filters for this window */
if
(
window_private
)
{
GdkFilterReturn
result
;
result
=
gdk_event_apply_filters
(
xevent
,
event
,
window_private
->
filters
);
if
(
result
!=
GDK_FILTER_CONTINUE
)
{
return
(
result
==
GDK_FILTER_TRANSLATE
)
?
TRUE
:
FALSE
;
}
}
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
* the conversion is fairly straightforward. We also
...
...
@@ -1555,7 +1660,7 @@ gdk_event_translate (GdkEvent *event,
{
/* retry */
/* alloc adequate size of buffer */
if
(
gdk_debug_level
>=
1
)
g_print
(
"XIM: overflow(required %i)
\n
"
,
charcount
);
g_print
(
"XIM: overflow
(required %i)
\n
"
,
charcount
);
while
(
buf_len
<=
charcount
)
buf_len
*=
2
;
...
...
@@ -1603,10 +1708,14 @@ gdk_event_translate (GdkEvent *event,
event
->
key
.
window
=
window
;
event
->
key
.
time
=
xevent
->
xkey
.
time
;
event
->
key
.
state
=
(
GdkModifierType
)
xevent
->
xkey
.
state
;
event
->
key
.
string
=
buf
;
event
->
key
.
string
=
g_strdup
(
buf
)
;
event
->
key
.
length
=
charcount
;
return_val
=
window_private
&&
!
window_private
->
destroyed
;
if
(
!
return_val
)
g_free
(
event
->
key
.
string
);
break
;
case
KeyRelease
:
...
...
@@ -2012,6 +2121,14 @@ gdk_event_translate (GdkEvent *event,
event
->
crossing
.
type
=
GDK_LEAVE_NOTIFY
;
event
->
crossing
.
window
=
window
;
/* If the subwindow field of the XEvent is non-NULL, then
* lookup the corresponding GdkWindow.
*/
if
(
xevent
->
xcrossing
.
subwindow
!=
None
)
event
->
crossing
.
subwindow
=
gdk_window_lookup
(
xevent
->
xcrossing
.
subwindow
);
else
event
->
crossing
.
subwindow
=
NULL
;
/* Translate the crossing detail into Gdk terms.
*/
switch
(
xevent
->
xcrossing
.
detail
)
...
...
@@ -2073,31 +2190,30 @@ gdk_event_translate (GdkEvent *event,
break
;
case
FocusIn
:
/* Print debugging info.
*/
if
(
gdk_show_events
)
g_print
(
"focus in:
\t\t
window: %ld
\n
"
,
xevent
->
xfocus
.
window
-
base_id
);
event
->
focus_change
.
type
=
GDK_FOCUS_CHANGE
;
event
->
focus_change
.
window
=
window
;
event
->
focus_change
.
in
=
TRUE
;
return_val
=
window_private
&&
!
window_private
->
destroyed
;
break
;
case
FocusOut
:
/* Print debugging info.
/* We only care about focus events that indicate that _this_
* window (not a ancestor or child) got or lost the focus
*/
if
(
gdk_show_events
)
g_print
(
"focus out:
\t\t
window: %ld
\n
"
,