configure.in acheader.h gdk/gdkwindow.c Check for Shape extension both on

Sun May  3 13:38:22 1998  Owen Taylor  <otaylor@gtk.org>

	* configure.in acheader.h gdk/gdkwindow.c
	Check for Shape extension both on the client and server
	side. (And, more importantly, check for the shape extension
	so we may include -lXext even when compiling with --disable-xshm)

	Don't set override_redirect on all shaped windows. It isn't
	necessary.

	* gdk/gdkwindow.c: Set ->colormap to NULL for root
	and foreign windows. Use this to check if we
	need to get the colormap from X.

Fri May  1 22:32:47 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
	between the default and the button always in GTK_STATE_NORMAL.

	* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
	callback.

Fri May  1 16:40:57 1998  Owen Taylor  <otaylor@gtk.org>

	* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
	  Fix a buffer overflow on pixmaps that claim to have
	  more than 31 characters per pixel.

	  (gdk_pixmap_read_string): Don't wrap around strings longer
 	  than half of address space ;-)

	* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
	that were used for printing integers.

	* */* (almost):

	Style: All
	  int foo () { ... }
	changed to
	  int foo (void) { ... }

^^^^^^^ This is why some many files changed

	Even where there were proper prototypes elsewhere.

	* gdk/gxid.c (handle_claim_device): Some extra checks.
	It isn't safe against being fed bad X id's, but at
	least it should be safe against deleting all your
	files.
This commit is contained in:
Owen Taylor 1998-05-03 22:41:32 +00:00 committed by Owen Taylor
parent c0b9232351
commit 4851efe296
125 changed files with 1192 additions and 475 deletions

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -1,7 +1,56 @@
Sun May 3 13:38:22 1998 Owen Taylor <otaylor@gtk.org>
* configure.in acheader.h gdk/gdkwindow.c
Check for Shape extension both on the client and server
side. (And, more importantly, check for the shape extension
so we may include -lXext even when compiling with --disable-xshm)
Don't set override_redirect on all shaped windows. It isn't
necessary.
* gdk/gdkwindow.c: Set ->colormap to NULL for root
and foreign windows. Use this to check if we
need to get the colormap from X.
Fri May 1 22:32:47 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
between the default and the button always in GTK_STATE_NORMAL.
* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
callback.
Fri May 1 16:40:57 1998 Owen Taylor <otaylor@gtk.org>
* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
Fix a buffer overflow on pixmaps that claim to have
more than 31 characters per pixel.
(gdk_pixmap_read_string): Don't wrap around strings longer
than half of address space ;-)
* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
that were used for printing integers.
* */* (almost):
Style: All
int foo () { ... }
changed to
int foo (void) { ... }
Even where there were proper prototypes elsewhere.
* gdk/gxid.c (handle_claim_device): Some extra checks.
It isn't safe against being fed bad X id's, but at
least it should be safe against deleting all your
files.
Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org> Sun May 3 19:45:09 1998 Tim Janik <timj@gtk.org>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function * gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
to set the adjustments value when there is no current emissioin. to set the adjustments value when there is no current emissioin.
[ Removed by mutual agreement owt 5/3/1998 ]
* gtk/gtksignal.c: added new functions to retrive the number of * gtk/gtksignal.c: added new functions to retrive the number of
existing emissions for a certain signal. existing emissions for a certain signal.
@ -50,6 +99,7 @@ Sat May 2 20:19:03 1998 Tim Janik <timj@gtk.org>
(gtk_adjustment_set_value): new function to emit the "value_changed" (gtk_adjustment_set_value): new function to emit the "value_changed"
signal. signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org> Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window * gtk/gtkcombo.c: Further changes to the way the window

View File

@ -17,8 +17,8 @@
/* Other stuff */ /* Other stuff */
#undef HAVE_IPC_H #undef HAVE_IPC_H
#undef HAVE_SHM_H #undef HAVE_SHM_H
#undef HAVE_XPM
#undef HAVE_XSHM_H #undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H #undef HAVE_SYS_SELECT_H
#undef IPC_RMID_DEFERRED_RELEASE #undef IPC_RMID_DEFERRED_RELEASE

View File

@ -18,8 +18,8 @@
/* Other stuff */ /* Other stuff */
#undef HAVE_IPC_H #undef HAVE_IPC_H
#undef HAVE_SHM_H #undef HAVE_SHM_H
#undef HAVE_XPM
#undef HAVE_XSHM_H #undef HAVE_XSHM_H
#undef HAVE_SHAPE_EXT
#undef HAVE_SYS_SELECT_H #undef HAVE_SYS_SELECT_H
#undef IPC_RMID_DEFERRED_RELEASE #undef IPC_RMID_DEFERRED_RELEASE

View File

@ -118,6 +118,14 @@ if test "x$enable_shm" = "xyes"; then
$x_libs) $x_libs)
fi 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_cflags="$X_CFLAGS" x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS" x_ldflags="$X_LDFLAGS $X_LIBS"

View File

@ -625,7 +625,7 @@ gdk_exit (int errorcode)
*/ */
gchar* gchar*
gdk_set_locale () gdk_set_locale (void)
{ {
if (!setlocale (LC_ALL,"")) if (!setlocale (LC_ALL,""))
g_print ("locale not supported by C library\n"); g_print ("locale not supported by C library\n");
@ -663,7 +663,7 @@ gdk_set_locale ()
*/ */
gint gint
gdk_events_pending () gdk_events_pending (void)
{ {
gint result; gint result;
GList *tmp_list; GList *tmp_list;
@ -1023,13 +1023,13 @@ gdk_set_use_xshm (gint use_xshm)
} }
gint gint
gdk_get_show_events () gdk_get_show_events (void)
{ {
return gdk_debug_flags & GDK_DEBUG_EVENTS; return gdk_debug_flags & GDK_DEBUG_EVENTS;
} }
gint gint
gdk_get_use_xshm () gdk_get_use_xshm (void)
{ {
return gdk_use_xshm; return gdk_use_xshm;
} }
@ -1055,7 +1055,7 @@ gdk_get_use_xshm ()
*/ */
guint32 guint32
gdk_time_get () gdk_time_get (void)
{ {
struct timeval end; struct timeval end;
struct timeval elapsed; struct timeval elapsed;
@ -1094,7 +1094,7 @@ gdk_time_get ()
*/ */
guint32 guint32
gdk_timer_get () gdk_timer_get (void)
{ {
return timer_val; return timer_val;
} }
@ -1129,13 +1129,13 @@ gdk_timer_set (guint32 milliseconds)
} }
void void
gdk_timer_enable () gdk_timer_enable (void)
{ {
timerp = &timer; timerp = &timer;
} }
void void
gdk_timer_disable () gdk_timer_disable (void)
{ {
timerp = NULL; timerp = NULL;
} }
@ -1463,7 +1463,7 @@ gdk_keyboard_ungrab (guint32 time)
*/ */
gint gint
gdk_screen_width () gdk_screen_width (void)
{ {
gint return_val; gint return_val;
@ -1488,7 +1488,7 @@ gdk_screen_width ()
*/ */
gint gint
gdk_screen_height () gdk_screen_height (void)
{ {
gint return_val; gint return_val;
@ -1498,13 +1498,13 @@ gdk_screen_height ()
} }
void void
gdk_key_repeat_disable () gdk_key_repeat_disable (void)
{ {
XAutoRepeatOff (gdk_display); XAutoRepeatOff (gdk_display);
} }
void void
gdk_key_repeat_restore () gdk_key_repeat_restore (void)
{ {
if (autorepeat) if (autorepeat)
XAutoRepeatOn (gdk_display); XAutoRepeatOn (gdk_display);
@ -1531,14 +1531,14 @@ gdk_key_repeat_restore ()
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
void gdk_flush () void gdk_flush (void)
{ {
XSync (gdk_display, False); XSync (gdk_display, False);
} }
void void
gdk_beep () gdk_beep (void)
{ {
XBell(gdk_display, 100); XBell(gdk_display, 100);
} }
@ -1562,7 +1562,7 @@ gdk_beep ()
*/ */
static gint static gint
gdk_event_wait () gdk_event_wait (void)
{ {
GList *list; GList *list;
GdkInput *input; GdkInput *input;
@ -3028,7 +3028,7 @@ gdk_synthesize_click (GdkEvent *event,
*/ */
static void static void
gdk_exit_func () gdk_exit_func (void)
{ {
static gboolean in_gdk_exit_func = FALSE; static gboolean in_gdk_exit_func = FALSE;

View File

@ -64,7 +64,7 @@ static GList *image_list = NULL;
void void
gdk_image_exit () gdk_image_exit (void)
{ {
GdkImage *image; GdkImage *image;
@ -131,7 +131,7 @@ gdk_image_check_xshm(Display *display)
} }
void void
gdk_image_init () gdk_image_init (void)
{ {
if (gdk_use_xshm) if (gdk_use_xshm)
{ {

View File

@ -70,7 +70,7 @@ static GList *gdk_input_windows;
#include "gdkinputgxi.h" #include "gdkinputgxi.h"
GList * GList *
gdk_input_list_devices () gdk_input_list_devices (void)
{ {
return gdk_input_devices; return gdk_input_devices;
} }

View File

@ -29,7 +29,7 @@ static void gdk_input_none_get_pointer (GdkWindow *window,
GdkModifierType *mask); GdkModifierType *mask);
void void
gdk_input_init () gdk_input_init (void)
{ {
gdk_input_vtable.set_mode = NULL; gdk_input_vtable.set_mode = NULL;
gdk_input_vtable.set_axes = NULL; gdk_input_vtable.set_axes = NULL;

View File

@ -22,7 +22,7 @@
/* forward declarations */ /* forward declarations */
static gint gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode); 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, static void gdk_input_xfree_configure_event (XConfigureEvent *xevent,
GdkWindow *window); GdkWindow *window);
static void gdk_input_xfree_enter_event (XCrossingEvent *xevent, static void gdk_input_xfree_enter_event (XCrossingEvent *xevent,
@ -115,7 +115,7 @@ gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode)
} }
static void static void
gdk_input_check_proximity() gdk_input_check_proximity (void)
{ {
gint new_proximity = 0; gint new_proximity = 0;
GList *tmp_list = gdk_input_devices; GList *tmp_list = gdk_input_devices;

View File

@ -256,8 +256,14 @@ gdk_pixmap_read_string (FILE *infile,
{ {
if (cnt == (*buffer_size)) if (cnt == (*buffer_size))
{ {
(*buffer_size) *= 2; guint new_size = (*buffer_size) * 2;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size); } if (new_size > (*buffer_size))
*buffer_size = new_size;
else
return FALSE;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size);
}
if (c != '"') if (c != '"')
(*buffer)[cnt++] = c; (*buffer)[cnt++] = c;
@ -399,6 +405,11 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
gdk_pixmap_read_string (infile, &buffer, &buffer_size); gdk_pixmap_read_string (infile, &buffer, &buffer_size);
sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp); sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp);
if (cpp >= 32)
{
g_warning ("Pixmap has more than 31 characters per color\n");
return NULL;
}
colors = g_new(_GdkPixmapColor, num_cols); colors = g_new(_GdkPixmapColor, num_cols);
@ -574,6 +585,11 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
i = 0; i = 0;
buffer = data[i++]; buffer = data[i++];
sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp); sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp);
if (cpp >= 32)
{
g_warning ("Pixmap has more than 31 characters per color\n");
return NULL;
}
colors = g_new(_GdkPixmapColor, num_cols); colors = g_new(_GdkPixmapColor, num_cols);

View File

@ -58,7 +58,7 @@ static gchar* visual_names[] =
static GHashTable *visual_hash = NULL; static GHashTable *visual_hash = NULL;
void void
gdk_visual_init () gdk_visual_init (void)
{ {
static gint possible_depths[6] = { 32, 24, 16, 15, 8, 1 }; static gint possible_depths[6] = { 32, 24, 16, 15, 8, 1 };
static GdkVisualType possible_types[6] = static GdkVisualType possible_types[6] =
@ -263,25 +263,25 @@ gdk_visual_unref (GdkVisual *visual)
} }
gint gint
gdk_visual_get_best_depth () gdk_visual_get_best_depth (void)
{ {
return available_depths[0]; return available_depths[0];
} }
GdkVisualType GdkVisualType
gdk_visual_get_best_type () gdk_visual_get_best_type (void)
{ {
return available_types[0]; return available_types[0];
} }
GdkVisual* GdkVisual*
gdk_visual_get_system () gdk_visual_get_system (void)
{ {
return ((GdkVisual*) system_visual); return ((GdkVisual*) system_visual);
} }
GdkVisual* GdkVisual*
gdk_visual_get_best () gdk_visual_get_best (void)
{ {
return ((GdkVisual*) &(visuals[0])); return ((GdkVisual*) &(visuals[0]));
} }

View File

@ -20,7 +20,6 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/extensions/shape.h>
#include <netinet/in.h> #include <netinet/in.h>
#include "gdk.h" #include "gdk.h"
#include "../config.h" #include "../config.h"
@ -30,6 +29,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_SHAPE_EXT
#include <X11/extensions/shape.h>
#endif
int nevent_masks = 17; int nevent_masks = 17;
int event_mask_table[19] = int event_mask_table[19] =
{ {
@ -172,7 +175,7 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
} }
void void
gdk_window_init () gdk_window_init (void)
{ {
XWindowAttributes xattributes; XWindowAttributes xattributes;
unsigned int width; unsigned int width;
@ -192,6 +195,7 @@ gdk_window_init ()
gdk_root_parent.width = width; gdk_root_parent.width = width;
gdk_root_parent.height = height; gdk_root_parent.height = height;
gdk_root_parent.children = NULL; gdk_root_parent.children = NULL;
gdk_root_parent.colormap = NULL;
} }
GdkWindow* GdkWindow*
@ -472,6 +476,7 @@ gdk_window_foreign_new (guint32 anid)
private->destroyed = FALSE; private->destroyed = FALSE;
private->extension_events = 0; private->extension_events = 0;
private->colormap = NULL;
private->dnd_drag_data_type = None; private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail = private->dnd_drag_data_typesavail =
@ -1195,8 +1200,7 @@ gdk_window_get_visual (GdkWindow *window)
if (window_private && !window_private->destroyed) if (window_private && !window_private->destroyed)
{ {
if ((window_private->window_type == GDK_WINDOW_FOREIGN)|| if (window_private->colormap == NULL)
(window_private->xwindow==DefaultRootWindow(window_private->xdisplay)))
{ {
XGetWindowAttributes (window_private->xdisplay, XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow, window_private->xwindow,
@ -1222,8 +1226,7 @@ gdk_window_get_colormap (GdkWindow *window)
g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL); g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
if (!window_private->destroyed) if (!window_private->destroyed)
{ {
if ((window_private->window_type == GDK_WINDOW_FOREIGN)|| if (window_private->colormap == NULL)
(window_private->xwindow==DefaultRootWindow(window_private->xdisplay)))
{ {
XGetWindowAttributes (window_private->xdisplay, XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow, window_private->xwindow,
@ -1479,8 +1482,7 @@ gdk_window_add_colormap_windows (GdkWindow *window)
/* /*
* This needs the X11 shape extension. * This needs the X11 shape extension.
* If not available, simply remove the call to * If not available, shaped windows will look
* XShapeCombineMask. Shaped windows will look
* ugly, but programs still work. Stefan Wille * ugly, but programs still work. Stefan Wille
*/ */
void void
@ -1488,38 +1490,53 @@ gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask, GdkBitmap *mask,
gint x, gint y) gint x, gint y)
{ {
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
GdkWindowPrivate *window_private; GdkWindowPrivate *window_private;
Pixmap pixmap; Pixmap pixmap;
g_return_if_fail (window != NULL); g_return_if_fail (window != NULL);
/* This is needed, according to raster */ #ifdef HAVE_SHAPE_EXT
gdk_window_set_override_redirect(window, TRUE); if (have_shape == UNKNOWN)
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mask)
{ {
GdkWindowPrivate *pixmap_private; int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
pixmap_private = (GdkWindowPrivate*) mask; have_shape = YES;
pixmap = (Pixmap) pixmap_private->xwindow; else
have_shape = NO;
} }
else
if (have_shape == YES)
{ {
x = 0; window_private = (GdkWindowPrivate*) window;
y = 0; if (window_private->destroyed)
pixmap = None; return;
if (mask)
{
GdkWindowPrivate *pixmap_private;
pixmap_private = (GdkWindowPrivate*) mask;
pixmap = (Pixmap) pixmap_private->xwindow;
}
else
{
x = 0;
y = 0;
pixmap = None;
}
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
x, y,
pixmap,
ShapeSet);
} }
#endif /* HAVE_SHAPE_EXT */
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
x, y,
pixmap,
ShapeSet);
} }
void void

View File

@ -61,7 +61,7 @@ handler(int signal)
} }
void void
init_socket() init_socket(void)
{ {
struct sockaddr_in sin; struct sockaddr_in sin;
@ -130,7 +130,7 @@ enable_device(GxidDevice *dev)
/* switch the core pointer from whatever it is now to something else, /* switch the core pointer from whatever it is now to something else,
return true on success, false otherwise */ return true on success, false otherwise */
static int static int
switch_core_pointer() switch_core_pointer(void)
{ {
GxidDevice *old_pointer = 0; GxidDevice *old_pointer = 0;
GxidDevice *new_pointer = 0; GxidDevice *new_pointer = 0;
@ -222,7 +222,7 @@ init_device(XDeviceInfo *xdevice)
} }
void void
init_xinput() init_xinput(void)
{ {
char **extensions; char **extensions;
XDeviceInfo *xdevices; XDeviceInfo *xdevices;
@ -279,12 +279,22 @@ int
handle_claim_device(GxidClaimDevice *msg) handle_claim_device(GxidClaimDevice *msg)
{ {
int i,j; int i,j;
XID devid = ntohl(msg->device); XID devid;
XID winid = ntohl(msg->window); XID winid;
int exclusive = ntohl(msg->exclusive); int exclusive;
GxidDevice *device = NULL; GxidDevice *device = NULL;
GxidWindow *window = NULL; GxidWindow *window = NULL;
if (msg->length != sizeof(GxidClaimDevice))
{
fprintf(stderr,"Bad length for ClaimDevice message\n");
return GXID_RETURN_ERROR;
}
devid = ntohl(msg->device);
winid = ntohl(msg->window);
exclusive = ntohl(msg->exclusive);
#ifdef DEBUG_CLIENTS #ifdef DEBUG_CLIENTS
fprintf(stderr,"device %ld claimed (window 0x%lx)\n",devid,winid); fprintf(stderr,"device %ld claimed (window 0x%lx)\n",devid,winid);
#endif #endif
@ -397,11 +407,20 @@ int
handle_release_device(GxidReleaseDevice *msg) handle_release_device(GxidReleaseDevice *msg)
{ {
int i,j; int i,j;
XID devid = ntohl(msg->device); XID devid;
XID winid = ntohl(msg->window); XID winid;
GxidDevice *device = NULL; GxidDevice *device = NULL;
if (msg->length != sizeof(GxidReleaseDevice))
{
fprintf(stderr,"Bad length for ReleaseDevice message\n");
return GXID_RETURN_ERROR;
}
devid = ntohl(msg->device);
winid = ntohl(msg->window);
#ifdef DEBUG_CLIENTS #ifdef DEBUG_CLIENTS
fprintf(stderr,"device %ld released (window 0x%lx)\n",devid,winid); fprintf(stderr,"device %ld released (window 0x%lx)\n",devid,winid);
#endif #endif
@ -460,11 +479,11 @@ handle_release_device(GxidReleaseDevice *msg)
} }
void void
handle_connection() handle_connection (void)
{ {
GxidMessage msg; GxidMessage msg;
GxidU32 type; GxidU32 type;
int length; GxidU32 length;
GxidI32 retval; GxidI32 retval;
int conn_fd; int conn_fd;
@ -496,7 +515,7 @@ handle_connection()
/* read rest of message */ /* read rest of message */
if (length > sizeof(GxidMessage)) if ((length > sizeof(GxidMessage)) || (length < 2*sizeof(GxidU32)))
{ {
fprintf(stderr,"%s: Bad message length\n", fprintf(stderr,"%s: Bad message length\n",
program_name); program_name);
@ -689,7 +708,7 @@ handle_destroy_notify(XDestroyWindowEvent *event)
} }
void void
handle_xevent() handle_xevent(void)
{ {
int i; int i;
XEvent event; XEvent event;
@ -743,7 +762,7 @@ handle_xevent()
} }
void void
usage() usage(void)
{ {
fprintf(stderr,"Usage: %s [-d display] [-p --gxid-port port]\n", fprintf(stderr,"Usage: %s [-d display] [-p --gxid-port port]\n",
program_name); program_name);
@ -833,7 +852,7 @@ main(int argc, char **argv)
} }
if (FD_ISSET(socket_fd,&readfds)) if (FD_ISSET(socket_fd,&readfds))
handle_connection(socket_fd); handle_connection();
while (XPending(dpy)) while (XPending(dpy))
handle_xevent(); handle_xevent();

View File

@ -64,7 +64,7 @@ static GList *image_list = NULL;
void void
gdk_image_exit () gdk_image_exit (void)
{ {
GdkImage *image; GdkImage *image;
@ -131,7 +131,7 @@ gdk_image_check_xshm(Display *display)
} }
void void
gdk_image_init () gdk_image_init (void)
{ {
if (gdk_use_xshm) if (gdk_use_xshm)
{ {

View File

@ -29,7 +29,7 @@ static void gdk_input_none_get_pointer (GdkWindow *window,
GdkModifierType *mask); GdkModifierType *mask);
void void
gdk_input_init () gdk_input_init (void)
{ {
gdk_input_vtable.set_mode = NULL; gdk_input_vtable.set_mode = NULL;
gdk_input_vtable.set_axes = NULL; gdk_input_vtable.set_axes = NULL;

View File

@ -22,7 +22,7 @@
/* forward declarations */ /* forward declarations */
static gint gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode); 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, static void gdk_input_xfree_configure_event (XConfigureEvent *xevent,
GdkWindow *window); GdkWindow *window);
static void gdk_input_xfree_enter_event (XCrossingEvent *xevent, static void gdk_input_xfree_enter_event (XCrossingEvent *xevent,
@ -115,7 +115,7 @@ gdk_input_xfree_set_mode (guint32 deviceid, GdkInputMode mode)
} }
static void static void
gdk_input_check_proximity() gdk_input_check_proximity (void)
{ {
gint new_proximity = 0; gint new_proximity = 0;
GList *tmp_list = gdk_input_devices; GList *tmp_list = gdk_input_devices;

View File

@ -70,7 +70,7 @@ static GList *gdk_input_windows;
#include "gdkinputgxi.h" #include "gdkinputgxi.h"
GList * GList *
gdk_input_list_devices () gdk_input_list_devices (void)
{ {
return gdk_input_devices; return gdk_input_devices;
} }

View File

@ -625,7 +625,7 @@ gdk_exit (int errorcode)
*/ */
gchar* gchar*
gdk_set_locale () gdk_set_locale (void)
{ {
if (!setlocale (LC_ALL,"")) if (!setlocale (LC_ALL,""))
g_print ("locale not supported by C library\n"); g_print ("locale not supported by C library\n");
@ -663,7 +663,7 @@ gdk_set_locale ()
*/ */
gint gint
gdk_events_pending () gdk_events_pending (void)
{ {
gint result; gint result;
GList *tmp_list; GList *tmp_list;
@ -1023,13 +1023,13 @@ gdk_set_use_xshm (gint use_xshm)
} }
gint gint
gdk_get_show_events () gdk_get_show_events (void)
{ {
return gdk_debug_flags & GDK_DEBUG_EVENTS; return gdk_debug_flags & GDK_DEBUG_EVENTS;
} }
gint gint
gdk_get_use_xshm () gdk_get_use_xshm (void)
{ {
return gdk_use_xshm; return gdk_use_xshm;
} }
@ -1055,7 +1055,7 @@ gdk_get_use_xshm ()
*/ */
guint32 guint32
gdk_time_get () gdk_time_get (void)
{ {
struct timeval end; struct timeval end;
struct timeval elapsed; struct timeval elapsed;
@ -1094,7 +1094,7 @@ gdk_time_get ()
*/ */
guint32 guint32
gdk_timer_get () gdk_timer_get (void)
{ {
return timer_val; return timer_val;
} }
@ -1129,13 +1129,13 @@ gdk_timer_set (guint32 milliseconds)
} }
void void
gdk_timer_enable () gdk_timer_enable (void)
{ {
timerp = &timer; timerp = &timer;
} }
void void
gdk_timer_disable () gdk_timer_disable (void)
{ {
timerp = NULL; timerp = NULL;
} }
@ -1463,7 +1463,7 @@ gdk_keyboard_ungrab (guint32 time)
*/ */
gint gint
gdk_screen_width () gdk_screen_width (void)
{ {
gint return_val; gint return_val;
@ -1488,7 +1488,7 @@ gdk_screen_width ()
*/ */
gint gint
gdk_screen_height () gdk_screen_height (void)
{ {
gint return_val; gint return_val;
@ -1498,13 +1498,13 @@ gdk_screen_height ()
} }
void void
gdk_key_repeat_disable () gdk_key_repeat_disable (void)
{ {
XAutoRepeatOff (gdk_display); XAutoRepeatOff (gdk_display);
} }
void void
gdk_key_repeat_restore () gdk_key_repeat_restore (void)
{ {
if (autorepeat) if (autorepeat)
XAutoRepeatOn (gdk_display); XAutoRepeatOn (gdk_display);
@ -1531,14 +1531,14 @@ gdk_key_repeat_restore ()
*-------------------------------------------------------------- *--------------------------------------------------------------
*/ */
void gdk_flush () void gdk_flush (void)
{ {
XSync (gdk_display, False); XSync (gdk_display, False);
} }
void void
gdk_beep () gdk_beep (void)
{ {
XBell(gdk_display, 100); XBell(gdk_display, 100);
} }
@ -1562,7 +1562,7 @@ gdk_beep ()
*/ */
static gint static gint
gdk_event_wait () gdk_event_wait (void)
{ {
GList *list; GList *list;
GdkInput *input; GdkInput *input;
@ -3028,7 +3028,7 @@ gdk_synthesize_click (GdkEvent *event,
*/ */
static void static void
gdk_exit_func () gdk_exit_func (void)
{ {
static gboolean in_gdk_exit_func = FALSE; static gboolean in_gdk_exit_func = FALSE;

View File

@ -256,8 +256,14 @@ gdk_pixmap_read_string (FILE *infile,
{ {
if (cnt == (*buffer_size)) if (cnt == (*buffer_size))
{ {
(*buffer_size) *= 2; guint new_size = (*buffer_size) * 2;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size); } if (new_size > (*buffer_size))
*buffer_size = new_size;
else
return FALSE;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size);
}
if (c != '"') if (c != '"')
(*buffer)[cnt++] = c; (*buffer)[cnt++] = c;
@ -399,6 +405,11 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
gdk_pixmap_read_string (infile, &buffer, &buffer_size); gdk_pixmap_read_string (infile, &buffer, &buffer_size);
sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp); sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp);
if (cpp >= 32)
{
g_warning ("Pixmap has more than 31 characters per color\n");
return NULL;
}
colors = g_new(_GdkPixmapColor, num_cols); colors = g_new(_GdkPixmapColor, num_cols);
@ -574,6 +585,11 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
i = 0; i = 0;
buffer = data[i++]; buffer = data[i++];
sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp); sscanf (buffer,"%d %d %d %d", &width, &height, &num_cols, &cpp);
if (cpp >= 32)
{
g_warning ("Pixmap has more than 31 characters per color\n");
return NULL;
}
colors = g_new(_GdkPixmapColor, num_cols); colors = g_new(_GdkPixmapColor, num_cols);

View File

@ -58,7 +58,7 @@ static gchar* visual_names[] =
static GHashTable *visual_hash = NULL; static GHashTable *visual_hash = NULL;
void void
gdk_visual_init () gdk_visual_init (void)
{ {
static gint possible_depths[6] = { 32, 24, 16, 15, 8, 1 }; static gint possible_depths[6] = { 32, 24, 16, 15, 8, 1 };
static GdkVisualType possible_types[6] = static GdkVisualType possible_types[6] =
@ -263,25 +263,25 @@ gdk_visual_unref (GdkVisual *visual)
} }
gint gint
gdk_visual_get_best_depth () gdk_visual_get_best_depth (void)
{ {
return available_depths[0]; return available_depths[0];
} }
GdkVisualType GdkVisualType
gdk_visual_get_best_type () gdk_visual_get_best_type (void)
{ {
return available_types[0]; return available_types[0];
} }
GdkVisual* GdkVisual*
gdk_visual_get_system () gdk_visual_get_system (void)
{ {
return ((GdkVisual*) system_visual); return ((GdkVisual*) system_visual);
} }
GdkVisual* GdkVisual*
gdk_visual_get_best () gdk_visual_get_best (void)
{ {
return ((GdkVisual*) &(visuals[0])); return ((GdkVisual*) &(visuals[0]));
} }

View File

@ -20,7 +20,6 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/extensions/shape.h>
#include <netinet/in.h> #include <netinet/in.h>
#include "gdk.h" #include "gdk.h"
#include "../config.h" #include "../config.h"
@ -30,6 +29,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_SHAPE_EXT
#include <X11/extensions/shape.h>
#endif
int nevent_masks = 17; int nevent_masks = 17;
int event_mask_table[19] = int event_mask_table[19] =
{ {
@ -172,7 +175,7 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
} }
void void
gdk_window_init () gdk_window_init (void)
{ {
XWindowAttributes xattributes; XWindowAttributes xattributes;
unsigned int width; unsigned int width;
@ -192,6 +195,7 @@ gdk_window_init ()
gdk_root_parent.width = width; gdk_root_parent.width = width;
gdk_root_parent.height = height; gdk_root_parent.height = height;
gdk_root_parent.children = NULL; gdk_root_parent.children = NULL;
gdk_root_parent.colormap = NULL;
} }
GdkWindow* GdkWindow*
@ -472,6 +476,7 @@ gdk_window_foreign_new (guint32 anid)
private->destroyed = FALSE; private->destroyed = FALSE;
private->extension_events = 0; private->extension_events = 0;
private->colormap = NULL;
private->dnd_drag_data_type = None; private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail = private->dnd_drag_data_typesavail =
@ -1195,8 +1200,7 @@ gdk_window_get_visual (GdkWindow *window)
if (window_private && !window_private->destroyed) if (window_private && !window_private->destroyed)
{ {
if ((window_private->window_type == GDK_WINDOW_FOREIGN)|| if (window_private->colormap == NULL)
(window_private->xwindow==DefaultRootWindow(window_private->xdisplay)))
{ {
XGetWindowAttributes (window_private->xdisplay, XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow, window_private->xwindow,
@ -1222,8 +1226,7 @@ gdk_window_get_colormap (GdkWindow *window)
g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL); g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
if (!window_private->destroyed) if (!window_private->destroyed)
{ {
if ((window_private->window_type == GDK_WINDOW_FOREIGN)|| if (window_private->colormap == NULL)
(window_private->xwindow==DefaultRootWindow(window_private->xdisplay)))
{ {
XGetWindowAttributes (window_private->xdisplay, XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow, window_private->xwindow,
@ -1479,8 +1482,7 @@ gdk_window_add_colormap_windows (GdkWindow *window)
/* /*
* This needs the X11 shape extension. * This needs the X11 shape extension.
* If not available, simply remove the call to * If not available, shaped windows will look
* XShapeCombineMask. Shaped windows will look
* ugly, but programs still work. Stefan Wille * ugly, but programs still work. Stefan Wille
*/ */
void void
@ -1488,38 +1490,53 @@ gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask, GdkBitmap *mask,
gint x, gint y) gint x, gint y)
{ {
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
GdkWindowPrivate *window_private; GdkWindowPrivate *window_private;
Pixmap pixmap; Pixmap pixmap;
g_return_if_fail (window != NULL); g_return_if_fail (window != NULL);
/* This is needed, according to raster */ #ifdef HAVE_SHAPE_EXT
gdk_window_set_override_redirect(window, TRUE); if (have_shape == UNKNOWN)
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mask)
{ {
GdkWindowPrivate *pixmap_private; int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
pixmap_private = (GdkWindowPrivate*) mask; have_shape = YES;
pixmap = (Pixmap) pixmap_private->xwindow; else
have_shape = NO;
} }
else
if (have_shape == YES)
{ {
x = 0; window_private = (GdkWindowPrivate*) window;
y = 0; if (window_private->destroyed)
pixmap = None; return;
if (mask)
{
GdkWindowPrivate *pixmap_private;
pixmap_private = (GdkWindowPrivate*) mask;
pixmap = (Pixmap) pixmap_private->xwindow;
}
else
{
x = 0;
y = 0;
pixmap = None;
}
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
x, y,
pixmap,
ShapeSet);
} }
#endif /* HAVE_SHAPE_EXT */
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
x, y,
pixmap,
ShapeSet);
} }
void void

View File

@ -61,7 +61,7 @@ handler(int signal)
} }
void void
init_socket() init_socket(void)
{ {
struct sockaddr_in sin; struct sockaddr_in sin;
@ -130,7 +130,7 @@ enable_device(GxidDevice *dev)
/* switch the core pointer from whatever it is now to something else, /* switch the core pointer from whatever it is now to something else,
return true on success, false otherwise */ return true on success, false otherwise */
static int static int
switch_core_pointer() switch_core_pointer(void)
{ {
GxidDevice *old_pointer = 0; GxidDevice *old_pointer = 0;
GxidDevice *new_pointer = 0; GxidDevice *new_pointer = 0;
@ -222,7 +222,7 @@ init_device(XDeviceInfo *xdevice)
} }
void void
init_xinput() init_xinput(void)
{ {
char **extensions; char **extensions;
XDeviceInfo *xdevices; XDeviceInfo *xdevices;
@ -279,12 +279,22 @@ int
handle_claim_device(GxidClaimDevice *msg) handle_claim_device(GxidClaimDevice *msg)
{ {
int i,j; int i,j;
XID devid = ntohl(msg->device); XID devid;
XID winid = ntohl(msg->window); XID winid;
int exclusive = ntohl(msg->exclusive); int exclusive;
GxidDevice *device = NULL; GxidDevice *device = NULL;
GxidWindow *window = NULL; GxidWindow *window = NULL;
if (msg->length != sizeof(GxidClaimDevice))
{
fprintf(stderr,"Bad length for ClaimDevice message\n");
return GXID_RETURN_ERROR;
}
devid = ntohl(msg->device);
winid = ntohl(msg->window);
exclusive = ntohl(msg->exclusive);
#ifdef DEBUG_CLIENTS #ifdef DEBUG_CLIENTS
fprintf(stderr,"device %ld claimed (window 0x%lx)\n",devid,winid); fprintf(stderr,"device %ld claimed (window 0x%lx)\n",devid,winid);
#endif #endif
@ -397,11 +407,20 @@ int
handle_release_device(GxidReleaseDevice *msg) handle_release_device(GxidReleaseDevice *msg)
{ {
int i,j; int i,j;
XID devid = ntohl(msg->device); XID devid;
XID winid = ntohl(msg->window); XID winid;
GxidDevice *device = NULL; GxidDevice *device = NULL;
if (msg->length != sizeof(GxidReleaseDevice))
{
fprintf(stderr,"Bad length for ReleaseDevice message\n");
return GXID_RETURN_ERROR;
}
devid = ntohl(msg->device);
winid = ntohl(msg->window);
#ifdef DEBUG_CLIENTS #ifdef DEBUG_CLIENTS
fprintf(stderr,"device %ld released (window 0x%lx)\n",devid,winid); fprintf(stderr,"device %ld released (window 0x%lx)\n",devid,winid);
#endif #endif
@ -460,11 +479,11 @@ handle_release_device(GxidReleaseDevice *msg)
} }
void void
handle_connection() handle_connection (void)
{ {
GxidMessage msg; GxidMessage msg;
GxidU32 type; GxidU32 type;
int length; GxidU32 length;
GxidI32 retval; GxidI32 retval;
int conn_fd; int conn_fd;
@ -496,7 +515,7 @@ handle_connection()
/* read rest of message */ /* read rest of message */
if (length > sizeof(GxidMessage)) if ((length > sizeof(GxidMessage)) || (length < 2*sizeof(GxidU32)))
{ {
fprintf(stderr,"%s: Bad message length\n", fprintf(stderr,"%s: Bad message length\n",
program_name); program_name);
@ -689,7 +708,7 @@ handle_destroy_notify(XDestroyWindowEvent *event)
} }
void void
handle_xevent() handle_xevent(void)
{ {
int i; int i;
XEvent event; XEvent event;
@ -743,7 +762,7 @@ handle_xevent()
} }
void void
usage() usage(void)
{ {
fprintf(stderr,"Usage: %s [-d display] [-p --gxid-port port]\n", fprintf(stderr,"Usage: %s [-d display] [-p --gxid-port port]\n",
program_name); program_name);
@ -833,7 +852,7 @@ main(int argc, char **argv)
} }
if (FD_ISSET(socket_fd,&readfds)) if (FD_ISSET(socket_fd,&readfds))
handle_connection(socket_fd); handle_connection();
while (XPending(dpy)) while (XPending(dpy))
handle_xevent(); handle_xevent();

View File

@ -1,3 +1,10 @@
Fri May 1 16:36:08 1998 Owen Taylor <otaylor@gtk.org>
* gutils.c: (g_strcasecmp). Check for isupper before
taking tolower, and account for macroized tolower.
* gutils.c (g_error): Check for recursion.
1998-04-27 Elliot Lee <sopwith@cuc.ml.org> 1998-04-27 Elliot Lee <sopwith@cuc.ml.org>
* glist.c (g_list_position): New function to find the position of * glist.c (g_list_position): New function to find the position of

View File

@ -33,7 +33,7 @@ static GRealListAllocator *current_allocator = NULL;
GListAllocator* GListAllocator*
g_list_allocator_new () g_list_allocator_new (void)
{ {
GRealListAllocator* allocator = g_new (GRealListAllocator, 1); GRealListAllocator* allocator = g_new (GRealListAllocator, 1);
@ -80,7 +80,7 @@ g_list_set_allocator (GListAllocator* fallocator)
GList* GList*
g_list_alloc () g_list_alloc (void)
{ {
GList *new_list; GList *new_list;

View File

@ -326,7 +326,7 @@ g_free (gpointer mem)
void void
g_mem_profile () g_mem_profile (void)
{ {
#ifdef MEM_PROFILE #ifdef MEM_PROFILE
gint i; gint i;
@ -749,7 +749,7 @@ g_mem_chunk_print (GMemChunk *mem_chunk)
} }
void void
g_mem_chunk_info () g_mem_chunk_info (void)
{ {
GRealMemChunk *mem_chunk; GRealMemChunk *mem_chunk;
gint count; gint count;
@ -773,7 +773,7 @@ g_mem_chunk_info ()
} }
void void
g_blow_chunks () g_blow_chunks (void)
{ {
GRealMemChunk *mem_chunk; GRealMemChunk *mem_chunk;

View File

@ -57,7 +57,7 @@ g_slist_set_allocator (GListAllocator* fallocator)
GSList* GSList*
g_slist_alloc () g_slist_alloc (void)
{ {
GSList *new_list; GSList *new_list;

View File

@ -32,7 +32,7 @@ struct _GRealTimer
GTimer* GTimer*
g_timer_new () g_timer_new (void)
{ {
GRealTimer *timer; GRealTimer *timer;

View File

@ -22,6 +22,7 @@
#include <string.h> #include <string.h>
#include <locale.h> #include <locale.h>
#include <ctype.h> /* For tolower() */ #include <ctype.h> /* For tolower() */
#include <unistd.h>
#include "glib.h" #include "glib.h"
@ -675,7 +676,14 @@ g_error (gchar *format, ...)
{ {
va_list args, args2; va_list args, args2;
char *buf; char *buf;
static gboolean errored = 0;
if (errored++)
{
write (2, "g_error: recursed!\n", 19);
return;
}
va_start (args, format); va_start (args, format);
va_start (args2, format); va_start (args2, format);
buf = g_vsprintf (format, &args, &args2); buf = g_vsprintf (format, &args, &args2);
@ -688,9 +696,10 @@ g_error (gchar *format, ...)
} }
else else
{ {
fputs ("\n** ERROR **: ", stderr); /* Use write() here because we might be out of memory */
fputs (buf, stderr); write (2, "\n** ERROR **: ", 14);
fputc ('\n', stderr); write (2, buf, strlen(buf));
write (2, "\n", 1);
} }
abort (); abort ();
@ -855,9 +864,14 @@ g_strcasecmp (const gchar *s1, const gchar *s2)
while (*s1 && *s2) while (*s1 && *s2)
{ {
c1 = tolower((guchar)(*s1++)); c2 = tolower((guchar)(*s2++)); /* According to A. Cox, some platforms have islower's that
* don't work right on non-uppercase
*/
c1 = isupper ((guchar)*s1) ? tolower ((guchar)*s1) : *s1;
c2 = isupper ((guchar)*s2) ? tolower ((guchar)*s2) : *s2;
if (c1 != c2) if (c1 != c2)
return (c1 - c2); return (c1 - c2);
s1++; s2++;
} }
return (((gint)(guchar) *s1) - ((gint)(guchar) *s2)); return (((gint)(guchar) *s1) - ((gint)(guchar) *s2));

View File

@ -44,7 +44,7 @@ static guint actable_key_id = 0;
GtkAcceleratorTable* GtkAcceleratorTable*
gtk_accelerator_table_new () gtk_accelerator_table_new (void)
{ {
GtkAcceleratorTable *table; GtkAcceleratorTable *table;

View File

@ -35,7 +35,7 @@ static guint adjustment_signals[LAST_SIGNAL] = { 0 };
GtkType GtkType
gtk_adjustment_get_type () gtk_adjustment_get_type (void)
{ {
static GtkType adjustment_type = 0; static GtkType adjustment_type = 0;
@ -136,18 +136,6 @@ gtk_adjustment_set_value (GtkAdjustment *adjustment,
} }
} }
void
gtk_adjustment_assimilate_value (GtkAdjustment *adjustment,
gfloat value)
{
g_return_if_fail (adjustment != NULL);
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
if (gtk_signal_n_emissions (GTK_OBJECT (adjustment),
adjustment_signals[VALUE_CHANGED]) == 0)
gtk_adjustment_set_value (adjustment, value);
}
void void
gtk_adjustment_changed (GtkAdjustment *adjustment) gtk_adjustment_changed (GtkAdjustment *adjustment)
{ {

View File

@ -28,7 +28,7 @@ static void gtk_alignment_size_allocate (GtkWidget *widget,
guint guint
gtk_alignment_get_type () gtk_alignment_get_type (void)
{ {
static guint alignment_type = 0; static guint alignment_type = 0;

View File

@ -29,7 +29,7 @@ static gint gtk_arrow_expose (GtkWidget *widget,
guint guint
gtk_arrow_get_type () gtk_arrow_get_type (void)
{ {
static guint arrow_type = 0; static guint arrow_type = 0;

View File

@ -38,7 +38,7 @@ static void gtk_aspect_frame_size_allocate (GtkWidget *widget,
#define MIN_RATIO 0.0001 #define MIN_RATIO 0.0001
guint guint
gtk_aspect_frame_get_type () gtk_aspect_frame_get_type (void)
{ {
static guint aspect_frame_type = 0; static guint aspect_frame_type = 0;

View File

@ -30,7 +30,7 @@ static gint default_child_ipad_y = 0;
guint guint
gtk_button_box_get_type () gtk_button_box_get_type (void)
{ {
static guint button_box_type = 0; static guint button_box_type = 0;

View File

@ -40,7 +40,7 @@ static GtkContainerClass *parent_class = NULL;
guint guint
gtk_bin_get_type () gtk_bin_get_type (void)
{ {
static guint bin_type = 0; static guint bin_type = 0;

View File

@ -51,7 +51,7 @@ static GtkContainerClass *parent_class = NULL;
guint guint
gtk_box_get_type () gtk_box_get_type (void)
{ {
static guint box_type = 0; static guint box_type = 0;

View File

@ -41,7 +41,7 @@ enum {
ARG_0, ARG_0,
ARG_LABEL ARG_LABEL
}; };
static void gtk_button_class_init (GtkButtonClass *klass); static void gtk_button_class_init (GtkButtonClass *klass);
@ -94,7 +94,7 @@ static guint button_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_button_get_type () gtk_button_get_type (void)
{ {
static guint button_type = 0; static guint button_type = 0;
@ -219,16 +219,16 @@ gtk_button_set_arg (GtkButton *button,
{ {
case ARG_LABEL: case ARG_LABEL:
gtk_container_disable_resize (GTK_CONTAINER (button)); gtk_container_disable_resize (GTK_CONTAINER (button));
if (button->child) if (button->child)
{ {
gtk_widget_unparent (button->child); gtk_widget_unparent (button->child);
button->child = NULL; button->child = NULL;
} }
label = gtk_label_new (GTK_VALUE_STRING(*arg)); label = gtk_label_new (GTK_VALUE_STRING(*arg));
gtk_widget_show (label); gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (button), label); gtk_container_add (GTK_CONTAINER (button), label);
gtk_container_enable_resize (GTK_CONTAINER (button)); gtk_container_enable_resize (GTK_CONTAINER (button));
break; break;
@ -239,7 +239,7 @@ gtk_button_set_arg (GtkButton *button,
} }
GtkWidget* GtkWidget*
gtk_button_new () gtk_button_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_button_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_button_get_type ()));
} }
@ -433,9 +433,9 @@ gtk_button_size_allocate (GtkWidget *widget,
DEFAULT_LEFT_POS); DEFAULT_LEFT_POS);
child_allocation.y += (GTK_WIDGET (widget)->style->klass->ythickness + child_allocation.y += (GTK_WIDGET (widget)->style->klass->ythickness +
DEFAULT_TOP_POS); DEFAULT_TOP_POS);
child_allocation.width = MAX (1, child_allocation.width - child_allocation.width = MAX (1, child_allocation.width -
(GTK_WIDGET (widget)->style->klass->xthickness * 2 + DEFAULT_SPACING)); (GTK_WIDGET (widget)->style->klass->xthickness * 2 + DEFAULT_SPACING));
child_allocation.height = MAX (1, child_allocation.height - child_allocation.height = MAX (1, child_allocation.height -
(GTK_WIDGET (widget)->style->klass->xthickness * 2 + DEFAULT_SPACING)); (GTK_WIDGET (widget)->style->klass->xthickness * 2 + DEFAULT_SPACING));
} }
@ -443,25 +443,60 @@ gtk_button_size_allocate (GtkWidget *widget,
} }
} }
/*
* +------------------------------------------------+
* | BORDER |
* | +------------------------------------------+ |
* | |\\\\\\\\\\\\\\\\DEFAULT\\\\\\\\\\\\\\\\\ | |
* | |\\+------------------------------------+ | |
* | |\\| | SPACING 3 | | | |
* | |\\| +--------------------------------+ | | |
* | |\\| |########## FOCUS ###############| | | |
* | |\\| |#+----------------------------+#| | | |
* | |\\| |#| RELIEF \|#| | | |
* | |\\| |#| +-----------------------+\|#| | | |
* | |\\|1|#| + THE TEXT +\|#|2| | |
* | |\\| |#| +-----------------------+\|#| | | |
* | |\\| |#| \\\\\ ythickness \\\\\\\\\\|#| | | |
* | |\\| |#+----------------------------+#| | | |
* | |\\| |########### 1 ##################| | | |
* | |\\| +--------------------------------+ | | |
* | |\\| | default spacing 4 | | | |
* | |\\+------------------------------------+ | |
* | |\ ythickness | |
* | +------------------------------------------+ |
* | border_width |
* +------------------------------------------------+
*/
static void static void
gtk_button_paint (GtkWidget *widget, gtk_button_paint (GtkWidget *widget,
GdkRectangle *area) GdkRectangle *area)
{ {
GdkRectangle restrict_area; GdkRectangle restrict_area;
GdkRectangle outer_area;
GdkRectangle tmp_area;
GdkRectangle new_area; GdkRectangle new_area;
gint xthickness;
gint ythickness;
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BUTTON (widget)); g_return_if_fail (GTK_IS_BUTTON (widget));
xthickness = widget->style->klass->xthickness;
ythickness = widget->style->klass->ythickness;
if (GTK_WIDGET_DRAWABLE (widget)) if (GTK_WIDGET_DRAWABLE (widget))
{ {
restrict_area.x = GTK_WIDGET (widget)->style->klass->xthickness; restrict_area.x = xthickness;
restrict_area.y = GTK_WIDGET (widget)->style->klass->ythickness; restrict_area.y = ythickness;
restrict_area.width = GTK_WIDGET (widget)->allocation.width - restrict_area.width = GTK_WIDGET (widget)->allocation.width -
restrict_area.x * 2 - GTK_CONTAINER (widget)->border_width * 2; restrict_area.x * 2 - GTK_CONTAINER (widget)->border_width * 2;
restrict_area.height = GTK_WIDGET (widget)->allocation.height - restrict_area.height = GTK_WIDGET (widget)->allocation.height -
restrict_area.y * 2 - GTK_CONTAINER (widget)->border_width * 2; restrict_area.y * 2 - GTK_CONTAINER (widget)->border_width * 2;
outer_area = restrict_area;
if (GTK_WIDGET_CAN_DEFAULT (widget)) if (GTK_WIDGET_CAN_DEFAULT (widget))
{ {
restrict_area.x += DEFAULT_LEFT_POS; restrict_area.x += DEFAULT_LEFT_POS;
@ -477,6 +512,49 @@ gtk_button_paint (GtkWidget *widget,
new_area.x, new_area.y, new_area.x, new_area.y,
new_area.width, new_area.height); new_area.width, new_area.height);
} }
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
/* Now fill spacing area between the default border and the button */
/* 1 */ tmp_area = outer_area;
tmp_area.width = restrict_area.x - outer_area.x;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
/* 2 */ tmp_area.x = restrict_area.x + restrict_area.width;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
/* 3 */ tmp_area.width = restrict_area.width;
tmp_area.height = restrict_area.y - outer_area.y;
tmp_area.x = restrict_area.x;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
/* 4 */ tmp_area.y = restrict_area.y + restrict_area.height;
if (gdk_rectangle_intersect (area, &tmp_area, &new_area))
gdk_draw_rectangle (widget->window,
widget->style->bg_gc[GTK_STATE_NORMAL],
TRUE,
new_area.x, new_area.y,
new_area.width, new_area.height);
}
} }
} }
@ -790,12 +868,12 @@ gtk_button_add (GtkContainer *container,
if (GTK_WIDGET_REALIZED (widget->parent) && if (GTK_WIDGET_REALIZED (widget->parent) &&
!GTK_WIDGET_REALIZED (widget)) !GTK_WIDGET_REALIZED (widget))
gtk_widget_realize (widget); gtk_widget_realize (widget);
if (GTK_WIDGET_MAPPED (widget->parent) && if (GTK_WIDGET_MAPPED (widget->parent) &&
!GTK_WIDGET_MAPPED (widget)) !GTK_WIDGET_MAPPED (widget))
gtk_widget_map (widget); gtk_widget_map (widget);
} }
button->child = widget; button->child = widget;
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container)) if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container))

View File

@ -47,7 +47,7 @@ static GtkToggleButtonClass *parent_class = NULL;
guint guint
gtk_check_button_get_type () gtk_check_button_get_type (void)
{ {
static guint check_button_type = 0; static guint check_button_type = 0;
@ -96,7 +96,7 @@ gtk_check_button_init (GtkCheckButton *check_button)
} }
GtkWidget* GtkWidget*
gtk_check_button_new () gtk_check_button_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_check_button_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_check_button_get_type ()));
} }

View File

@ -48,7 +48,7 @@ static guint check_menu_item_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_check_menu_item_get_type () gtk_check_menu_item_get_type (void)
{ {
static guint check_menu_item_type = 0; static guint check_menu_item_type = 0;
@ -72,7 +72,7 @@ gtk_check_menu_item_get_type ()
} }
GtkWidget* GtkWidget*
gtk_check_menu_item_new () gtk_check_menu_item_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_check_menu_item_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_check_menu_item_get_type ()));
} }

View File

@ -281,7 +281,7 @@ static guint clist_signals[LAST_SIGNAL] = {0};
GtkType GtkType
gtk_clist_get_type () gtk_clist_get_type (void)
{ {
static GtkType clist_type = 0; static GtkType clist_type = 0;

View File

@ -191,7 +191,7 @@ scale_val_type scale_vals[NUM_CHANNELS] =
}; };
guint guint
gtk_color_selection_get_type () gtk_color_selection_get_type (void)
{ {
static guint color_selection_type = 0; static guint color_selection_type = 0;
@ -1428,7 +1428,7 @@ gtk_color_selection_rgb_to_hsv (gdouble r, gdouble g, gdouble b,
/***************************/ /***************************/
guint guint
gtk_color_selection_dialog_get_type () gtk_color_selection_dialog_get_type (void)
{ {
static guint color_selection_dialog_type = 0; static guint color_selection_dialog_type = 0;

View File

@ -671,7 +671,7 @@ gtk_combo_init (GtkCombo * combo)
} }
guint guint
gtk_combo_get_type () gtk_combo_get_type (void)
{ {
static guint combo_type = 0; static guint combo_type = 0;
@ -693,7 +693,7 @@ gtk_combo_get_type ()
} }
GtkWidget * GtkWidget *
gtk_combo_new () gtk_combo_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_combo_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_combo_get_type ()));
} }

View File

@ -116,7 +116,7 @@ static const gchar *hadjustment_key = "gtk-hadjustment";
static guint hadjustment_key_id = 0; static guint hadjustment_key_id = 0;
GtkType GtkType
gtk_container_get_type () gtk_container_get_type (void)
{ {
static GtkType container_type = 0; static GtkType container_type = 0;

View File

@ -196,7 +196,7 @@ static guint ctree_signals[LAST_SIGNAL] = {0};
GtkType GtkType
gtk_ctree_get_type () gtk_ctree_get_type (void)
{ {
static GtkType ctree_type = 0; static GtkType ctree_type = 0;

View File

@ -33,7 +33,7 @@ static guint data_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_data_get_type () gtk_data_get_type (void)
{ {
static guint data_type = 0; static guint data_type = 0;

View File

@ -28,7 +28,7 @@ static void gtk_dialog_init (GtkDialog *dialog);
guint guint
gtk_dialog_get_type () gtk_dialog_get_type (void)
{ {
static guint dialog_type = 0; static guint dialog_type = 0;
@ -76,7 +76,7 @@ gtk_dialog_init (GtkDialog *dialog)
} }
GtkWidget* GtkWidget*
gtk_dialog_new () gtk_dialog_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_dialog_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_dialog_get_type ()));
} }

View File

@ -28,7 +28,7 @@ static void gtk_drawing_area_send_configure (GtkDrawingArea *darea);
guint guint
gtk_drawing_area_get_type () gtk_drawing_area_get_type (void)
{ {
static guint drawing_area_type = 0; static guint drawing_area_type = 0;
@ -72,7 +72,7 @@ gtk_drawing_area_init (GtkDrawingArea *darea)
GtkWidget* GtkWidget*
gtk_drawing_area_new () gtk_drawing_area_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_drawing_area_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_drawing_area_get_type ()));
} }

View File

@ -60,7 +60,7 @@ static GdkAtom text_atom = GDK_NONE;
static GdkAtom clipboard_atom = GDK_NONE; static GdkAtom clipboard_atom = GDK_NONE;
guint guint
gtk_editable_get_type () gtk_editable_get_type (void)
{ {
static guint editable_type = 0; static guint editable_type = 0;

View File

@ -181,7 +181,7 @@ static GtkTextFunction alt_keys[26] =
guint guint
gtk_entry_get_type () gtk_entry_get_type (void)
{ {
static guint entry_type = 0; static guint entry_type = 0;
@ -267,7 +267,7 @@ gtk_entry_init (GtkEntry *entry)
} }
GtkWidget* GtkWidget*
gtk_entry_new () gtk_entry_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_entry_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_entry_get_type ()));
} }

View File

@ -34,7 +34,7 @@ static gint gtk_event_box_expose (GtkWidget *widget,
guint guint
gtk_event_box_get_type () gtk_event_box_get_type (void)
{ {
static guint event_box_type = 0; static guint event_box_type = 0;
@ -79,7 +79,7 @@ gtk_event_box_init (GtkEventBox *event_box)
} }
GtkWidget* GtkWidget*
gtk_event_box_new () gtk_event_box_new (void)
{ {
return GTK_WIDGET ( gtk_type_new (gtk_event_box_get_type ())); return GTK_WIDGET ( gtk_type_new (gtk_event_box_get_type ()));
} }

View File

@ -318,7 +318,7 @@ static GtkWindowClass *parent_class = NULL;
static gint cmpl_errno; static gint cmpl_errno;
guint guint
gtk_file_selection_get_type () gtk_file_selection_get_type (void)
{ {
static guint file_selection_type = 0; static guint file_selection_type = 0;

View File

@ -47,7 +47,7 @@ static GtkContainerClass *parent_class = NULL;
guint guint
gtk_fixed_get_type () gtk_fixed_get_type (void)
{ {
static guint fixed_type = 0; static guint fixed_type = 0;
@ -106,7 +106,7 @@ gtk_fixed_init (GtkFixed *fixed)
} }
GtkWidget* GtkWidget*
gtk_fixed_new () gtk_fixed_new (void)
{ {
GtkFixed *fixed; GtkFixed *fixed;

View File

@ -55,7 +55,7 @@ static GtkBinClass *parent_class = NULL;
guint guint
gtk_frame_get_type () gtk_frame_get_type (void)
{ {
static guint frame_type = 0; static guint frame_type = 0;

View File

@ -91,7 +91,7 @@ gtk_gc_release (GdkGC *gc)
static void static void
gtk_gc_init () gtk_gc_init (void)
{ {
initialize = FALSE; initialize = FALSE;

View File

@ -31,7 +31,7 @@ static gint default_spacing = 30;
static gint default_layout_style = GTK_BUTTONBOX_EDGE; static gint default_layout_style = GTK_BUTTONBOX_EDGE;
guint guint
gtk_hbutton_box_get_type () gtk_hbutton_box_get_type (void)
{ {
static guint hbutton_box_type = 0; static guint hbutton_box_type = 0;
@ -72,7 +72,7 @@ gtk_hbutton_box_init (GtkHButtonBox *hbutton_box)
} }
GtkWidget* GtkWidget*
gtk_hbutton_box_new () gtk_hbutton_box_new (void)
{ {
GtkHButtonBox *hbutton_box; GtkHButtonBox *hbutton_box;

View File

@ -28,7 +28,7 @@ static void gtk_hbox_size_allocate (GtkWidget *widget,
guint guint
gtk_hbox_get_type () gtk_hbox_get_type (void)
{ {
static guint hbox_type = 0; static guint hbox_type = 0;

View File

@ -37,7 +37,7 @@ static gint gtk_hpaned_motion (GtkWidget *widget,
GdkEventMotion *event); GdkEventMotion *event);
guint guint
gtk_hpaned_get_type () gtk_hpaned_get_type (void)
{ {
static guint hpaned_type = 0; static guint hpaned_type = 0;
@ -81,7 +81,7 @@ gtk_hpaned_init (GtkHPaned *hpaned)
} }
GtkWidget* GtkWidget*
gtk_hpaned_new () gtk_hpaned_new (void)
{ {
GtkHPaned *hpaned; GtkHPaned *hpaned;

View File

@ -39,7 +39,7 @@ static void gtk_hruler_draw_pos (GtkRuler *ruler);
guint guint
gtk_hruler_get_type () gtk_hruler_get_type (void)
{ {
static guint hruler_type = 0; static guint hruler_type = 0;
@ -89,7 +89,7 @@ gtk_hruler_init (GtkHRuler *hruler)
GtkWidget* GtkWidget*
gtk_hruler_new () gtk_hruler_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_hruler_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_hruler_get_type ()));
} }
@ -136,7 +136,7 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
gfloat step_incr; gfloat step_incr;
gfloat increment; gfloat increment;
gfloat start, end, cur; gfloat start, end, cur;
gchar unit_str[12]; gchar unit_str[32];
gint text_height; gint text_height;
gint digit_height; gint digit_height;
gint pos; gint pos;

View File

@ -46,7 +46,7 @@ static gint gtk_hscale_trough_keys (GtkRange *range,
GtkTroughType *pos); GtkTroughType *pos);
guint guint
gtk_hscale_get_type () gtk_hscale_get_type (void)
{ {
static guint hscale_type = 0; static guint hscale_type = 0;

View File

@ -42,7 +42,7 @@ static gint gtk_hscrollbar_trough_keys (GtkRange *range,
guint guint
gtk_hscrollbar_get_type () gtk_hscrollbar_get_type (void)
{ {
static guint hscrollbar_type = 0; static guint hscrollbar_type = 0;

View File

@ -26,7 +26,7 @@ static gint gtk_hseparator_expose (GtkWidget *widget,
guint guint
gtk_hseparator_get_type () gtk_hseparator_get_type (void)
{ {
static guint hseparator_type = 0; static guint hseparator_type = 0;
@ -67,7 +67,7 @@ gtk_hseparator_init (GtkHSeparator *hseparator)
} }
GtkWidget* GtkWidget*
gtk_hseparator_new () gtk_hseparator_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_hseparator_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_hseparator_get_type ()));
} }

View File

@ -27,7 +27,7 @@ static gint gtk_image_expose (GtkWidget *widget,
guint guint
gtk_image_get_type () gtk_image_get_type (void)
{ {
static guint image_type = 0; static guint image_type = 0;

View File

@ -128,7 +128,7 @@ gtk_input_dialog_get_device_info(guint32 deviceid)
} }
guint guint
gtk_input_dialog_get_type () gtk_input_dialog_get_type (void)
{ {
static guint input_dialog_type = 0; static guint input_dialog_type = 0;
@ -650,7 +650,7 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDeviceInfo *info)
GtkWidget *label; GtkWidget *label;
GtkWidget *button; GtkWidget *button;
char buffer[16]; char buffer[32];
/* remove all the old items */ /* remove all the old items */
if (inputd->keys_list) if (inputd->keys_list)

View File

@ -43,7 +43,7 @@ static guint item_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_item_get_type () gtk_item_get_type (void)
{ {
static guint item_type = 0; static guint item_type = 0;

View File

@ -50,7 +50,7 @@ static GtkMiscClass *parent_class = NULL;
guint guint
gtk_label_get_type () gtk_label_get_type (void)
{ {
static guint label_type = 0; static guint label_type = 0;

View File

@ -80,7 +80,7 @@ static guint list_signals[LAST_SIGNAL] = { 0 };
GtkType GtkType
gtk_list_get_type () gtk_list_get_type (void)
{ {
static guint list_type = 0; static guint list_type = 0;
@ -179,7 +179,7 @@ gtk_list_init (GtkList *list)
} }
GtkWidget* GtkWidget*
gtk_list_new () gtk_list_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_list_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_list_get_type ()));
} }

View File

@ -47,7 +47,7 @@ static GtkItemClass *parent_class = NULL;
guint guint
gtk_list_item_get_type () gtk_list_item_get_type (void)
{ {
static guint list_item_type = 0; static guint list_item_type = 0;
@ -103,7 +103,7 @@ gtk_list_item_init (GtkListItem *list_item)
} }
GtkWidget* GtkWidget*
gtk_list_item_new () gtk_list_item_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_list_item_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_list_item_get_type ()));
} }

View File

@ -377,13 +377,13 @@ gtk_exit (int errorcode)
} }
gchar* gchar*
gtk_set_locale () gtk_set_locale (void)
{ {
return gdk_set_locale (); return gdk_set_locale ();
} }
void void
gtk_main () gtk_main (void)
{ {
GList *tmp_list; GList *tmp_list;
GList *functions; GList *functions;
@ -454,7 +454,7 @@ gtk_main_level (void)
} }
void void
gtk_main_quit () gtk_main_quit (void)
{ {
iteration_done = TRUE; iteration_done = TRUE;
} }
@ -498,7 +498,7 @@ gtk_events_pending (void)
} }
gint gint
gtk_main_iteration () gtk_main_iteration (void)
{ {
return gtk_main_iteration_do (TRUE); return gtk_main_iteration_do (TRUE);
} }
@ -1314,7 +1314,7 @@ gtk_input_remove (guint tag)
} }
GdkEvent * GdkEvent *
gtk_get_current_event () gtk_get_current_event (void)
{ {
if (current_events) if (current_events)
return gdk_event_copy ((GdkEvent *) current_events->data); return gdk_event_copy ((GdkEvent *) current_events->data);
@ -1335,7 +1335,7 @@ gtk_get_event_widget (GdkEvent *event)
} }
static void static void
gtk_exit_func () gtk_exit_func (void)
{ {
if (initialized) if (initialized)
{ {
@ -1430,7 +1430,7 @@ gtk_handle_current_timeouts (guint32 the_time)
} }
static void static void
gtk_handle_timeouts () gtk_handle_timeouts (void)
{ {
guint32 the_time; guint32 the_time;
GList *tmp_list; GList *tmp_list;
@ -1512,7 +1512,7 @@ gtk_idle_invoke_function (GtkIdleFunction *idlef)
} }
static void static void
gtk_handle_current_idles () gtk_handle_current_idles (void)
{ {
GList *tmp_list; GList *tmp_list;
GList *tmp_list2; GList *tmp_list2;
@ -1574,7 +1574,7 @@ gtk_handle_current_idles ()
} }
static void static void
gtk_handle_idle () gtk_handle_idle (void)
{ {
/* Caller must already have called gtk_handle_current_idles if /* Caller must already have called gtk_handle_current_idles if
* necessary * necessary
@ -1608,7 +1608,7 @@ gtk_handle_idle ()
} }
static void static void
gtk_handle_timer () gtk_handle_timer (void)
{ {
GtkTimeoutFunction *timeoutf; GtkTimeoutFunction *timeoutf;

View File

@ -66,7 +66,7 @@ static const gchar *attach_data_key = "gtk-menu-attach-data";
guint guint
gtk_menu_get_type () gtk_menu_get_type (void)
{ {
static guint menu_type = 0; static guint menu_type = 0;
@ -244,7 +244,7 @@ gtk_menu_detach (GtkMenu *menu)
} }
GtkWidget* GtkWidget*
gtk_menu_new () gtk_menu_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_menu_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_menu_get_type ()));
} }

View File

@ -39,7 +39,7 @@ static gint gtk_menu_bar_expose (GtkWidget *widget,
guint guint
gtk_menu_bar_get_type () gtk_menu_bar_get_type (void)
{ {
static guint menu_bar_type = 0; static guint menu_bar_type = 0;
@ -85,7 +85,7 @@ gtk_menu_bar_init (GtkMenuBar *menu_bar)
} }
GtkWidget* GtkWidget*
gtk_menu_bar_new () gtk_menu_bar_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_menu_bar_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_menu_bar_get_type ()));
} }

View File

@ -70,7 +70,7 @@ static guint menu_item_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_menu_item_get_type () gtk_menu_item_get_type (void)
{ {
static guint menu_item_type = 0; static guint menu_item_type = 0;
@ -159,7 +159,7 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
} }
GtkWidget* GtkWidget*
gtk_menu_item_new () gtk_menu_item_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_menu_item_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_menu_item_get_type ()));
} }

View File

@ -63,7 +63,7 @@ static guint menu_shell_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_menu_shell_get_type () gtk_menu_shell_get_type (void)
{ {
static guint menu_shell_type = 0; static guint menu_shell_type = 0;

View File

@ -40,7 +40,7 @@ static void gtk_misc_get_arg (GtkMisc *misc,
guint guint
gtk_misc_get_type () gtk_misc_get_type (void)
{ {
static guint misc_type = 0; static guint misc_type = 0;

View File

@ -144,7 +144,7 @@ static GtkContainerClass *parent_class = NULL;
static guint notebook_signals[LAST_SIGNAL] = { 0 }; static guint notebook_signals[LAST_SIGNAL] = { 0 };
guint guint
gtk_notebook_get_type () gtk_notebook_get_type (void)
{ {
static guint notebook_type = 0; static guint notebook_type = 0;
@ -243,7 +243,7 @@ gtk_notebook_init (GtkNotebook *notebook)
} }
GtkWidget* GtkWidget*
gtk_notebook_new () gtk_notebook_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_notebook_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_notebook_get_type ()));
} }

View File

@ -135,7 +135,7 @@ gtk_object_pointer_hash (const gpointer v)
****************************************************/ ****************************************************/
void void
gtk_object_init_type () gtk_object_init_type (void)
{ {
GtkType object_type = 0; GtkType object_type = 0;
GtkTypeInfo object_info = GtkTypeInfo object_info =
@ -159,7 +159,7 @@ gtk_object_init_type ()
} }
GtkType GtkType
gtk_object_get_type () gtk_object_get_type (void)
{ {
return GTK_TYPE_OBJECT; return GTK_TYPE_OBJECT;
} }
@ -1171,7 +1171,7 @@ gtk_object_data_destroy (GtkObjectData *odata)
} }
static guint* static guint*
gtk_object_data_id_alloc () gtk_object_data_id_alloc (void)
{ {
static guint next_id = 1; static guint next_id = 1;
guint *ids; guint *ids;

View File

@ -63,7 +63,7 @@ static GtkButtonClass *parent_class = NULL;
guint guint
gtk_option_menu_get_type () gtk_option_menu_get_type (void)
{ {
static guint option_menu_type = 0; static guint option_menu_type = 0;
@ -123,7 +123,7 @@ gtk_option_menu_init (GtkOptionMenu *option_menu)
} }
GtkWidget* GtkWidget*
gtk_option_menu_new () gtk_option_menu_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_option_menu_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_option_menu_get_type ()));
} }

View File

@ -40,7 +40,7 @@ static GtkContainerClass *parent_class = NULL;
guint guint
gtk_paned_get_type () gtk_paned_get_type (void)
{ {
static guint paned_type = 0; static guint paned_type = 0;

View File

@ -29,7 +29,7 @@ static void gtk_pixmap_finalize (GtkObject *object);
static GtkWidgetClass *parent_class; static GtkWidgetClass *parent_class;
guint guint
gtk_pixmap_get_type () gtk_pixmap_get_type (void)
{ {
static guint pixmap_type = 0; static guint pixmap_type = 0;

View File

@ -126,7 +126,7 @@ static gint install_cmap = FALSE;
guint guint
gtk_preview_get_type () gtk_preview_get_type (void)
{ {
static guint preview_type = 0; static guint preview_type = 0;
@ -287,7 +287,7 @@ gtk_preview_init (GtkPreview *preview)
} }
void void
gtk_preview_uninit () gtk_preview_uninit (void)
{ {
GtkPreviewProp *prop; GtkPreviewProp *prop;
GdkAtom property; GdkAtom property;
@ -674,7 +674,7 @@ gtk_preview_set_reserved (gint nreserved)
} }
GdkVisual* GdkVisual*
gtk_preview_get_visual () gtk_preview_get_visual (void)
{ {
if (!preview_class) if (!preview_class)
preview_class = gtk_type_class (gtk_preview_get_type ()); preview_class = gtk_type_class (gtk_preview_get_type ());
@ -683,7 +683,7 @@ gtk_preview_get_visual ()
} }
GdkColormap* GdkColormap*
gtk_preview_get_cmap () gtk_preview_get_cmap (void)
{ {
if (!preview_class) if (!preview_class)
preview_class = gtk_type_class (gtk_preview_get_type ()); preview_class = gtk_type_class (gtk_preview_get_type ());
@ -692,7 +692,7 @@ gtk_preview_get_cmap ()
} }
GtkPreviewInfo* GtkPreviewInfo*
gtk_preview_get_info () gtk_preview_get_info (void)
{ {
if (!preview_class) if (!preview_class)
preview_class = gtk_type_class (gtk_preview_get_type ()); preview_class = gtk_type_class (gtk_preview_get_type ());

View File

@ -35,7 +35,7 @@ static void gtk_progress_bar_paint (GtkProgressBar *pbar);
guint guint
gtk_progress_bar_get_type () gtk_progress_bar_get_type (void)
{ {
static guint progress_bar_type = 0; static guint progress_bar_type = 0;
@ -83,7 +83,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar)
GtkWidget* GtkWidget*
gtk_progress_bar_new () gtk_progress_bar_new (void)
{ {
return GTK_WIDGET (gtk_type_new (gtk_progress_bar_get_type ())); return GTK_WIDGET (gtk_type_new (gtk_progress_bar_get_type ()));
} }

View File

@ -36,7 +36,7 @@ static GtkCheckButtonClass *parent_class = NULL;
guint guint
gtk_radio_button_get_type () gtk_radio_button_get_type (void)
{ {
static guint radio_button_type = 0; static guint radio_button_type = 0;

View File

@ -28,7 +28,7 @@ static void gtk_radio_menu_item_draw_indicator (GtkCheckMenuItem *check_men
guint guint
gtk_radio_menu_item_get_type () gtk_radio_menu_item_get_type (void)
{ {
static guint radio_menu_item_type = 0; static guint radio_menu_item_type = 0;

View File

@ -54,6 +54,9 @@ static gint gtk_range_focus_in (GtkWidget *widget,
GdkEventFocus *event); GdkEventFocus *event);
static gint gtk_range_focus_out (GtkWidget *widget, static gint gtk_range_focus_out (GtkWidget *widget,
GdkEventFocus *event); GdkEventFocus *event);
static void gtk_range_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_real_range_draw_trough (GtkRange *range); static void gtk_real_range_draw_trough (GtkRange *range);
static void gtk_real_range_draw_slider (GtkRange *range); static void gtk_real_range_draw_slider (GtkRange *range);
static gint gtk_real_range_timer (GtkRange *range); static gint gtk_real_range_timer (GtkRange *range);
@ -79,7 +82,7 @@ static GtkWidgetClass *parent_class = NULL;
guint guint
gtk_range_get_type () gtk_range_get_type (void)
{ {
static guint range_type = 0; static guint range_type = 0;
@ -127,6 +130,7 @@ gtk_range_class_init (GtkRangeClass *class)
widget_class->leave_notify_event = gtk_range_leave_notify; widget_class->leave_notify_event = gtk_range_leave_notify;
widget_class->focus_in_event = gtk_range_focus_in; widget_class->focus_in_event = gtk_range_focus_in;
widget_class->focus_out_event = gtk_range_focus_out; widget_class->focus_out_event = gtk_range_focus_out;
widget_class->style_set = gtk_range_style_set;
class->slider_width = 11; class->slider_width = 11;
class->stepper_size = 11; class->stepper_size = 11;
@ -1455,3 +1459,39 @@ gtk_range_trough_vdims (GtkRange *range,
*bottom = tbottom; *bottom = tbottom;
} }
static void
gtk_range_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
GtkRange *range;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_RANGE (widget));
range = GTK_RANGE (widget);
if (GTK_WIDGET_REALIZED (widget) &&
!GTK_WIDGET_NO_WINDOW (widget))
{
if (range->trough)
{
gtk_style_set_background (widget->style, range->trough, GTK_STATE_ACTIVE);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (range->trough);
}
/* The draw will take care of the slider */
if (range->step_forw)
{
gtk_style_set_background (widget->style, range->step_forw, GTK_STATE_ACTIVE);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (range->step_forw);
}
if (range->step_back)
{
gtk_style_set_background (widget->style, range->step_back, GTK_STATE_ACTIVE);
if (GTK_WIDGET_DRAWABLE (widget))
gdk_window_clear (range->step_back);
}
}
}

View File

@ -18,6 +18,8 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@ -64,6 +66,7 @@ enum {
typedef struct _GtkRcStyle GtkRcStyle; typedef struct _GtkRcStyle GtkRcStyle;
typedef struct _GtkRcSet GtkRcSet; typedef struct _GtkRcSet GtkRcSet;
typedef struct _GtkRcNode GtkRcNode; typedef struct _GtkRcNode GtkRcNode;
typedef struct _GtkRcFile GtkRcFile;
struct _GtkRcNode struct _GtkRcNode
{ {
@ -87,6 +90,13 @@ struct _GtkRcSet
GtkRcStyle *rc_style; GtkRcStyle *rc_style;
}; };
struct _GtkRcFile
{
time_t mtime;
gchar *name;
gchar *canonical_name;
gboolean reload;
};
static guint gtk_rc_style_hash (const char *name); static guint gtk_rc_style_hash (const char *name);
static gint gtk_rc_style_compare (const char *a, static gint gtk_rc_style_compare (const char *a,
@ -98,6 +108,9 @@ static gint gtk_rc_style_match (const char *set,
const char *path); const char *path);
static GtkStyle* gtk_rc_style_init (GtkRcStyle *rc_style, static GtkStyle* gtk_rc_style_init (GtkRcStyle *rc_style,
GdkColormap *cmap); GdkColormap *cmap);
static void gtk_rc_parse_file (const gchar *filename,
gboolean reload);
static void gtk_rc_parse_any (const gchar *input_name, static void gtk_rc_parse_any (const gchar *input_name,
gint input_fd, gint input_fd,
const gchar *input_string); const gchar *input_string);
@ -131,6 +144,11 @@ static gint gtk_rc_parse_widget_style (GScanner *scanner);
static gint gtk_rc_parse_widget_class_style (GScanner *scanner); static gint gtk_rc_parse_widget_class_style (GScanner *scanner);
static char* gtk_rc_widget_path (GtkWidget *widget); static char* gtk_rc_widget_path (GtkWidget *widget);
static char* gtk_rc_widget_class_path (GtkWidget *widget); static char* gtk_rc_widget_class_path (GtkWidget *widget);
static void gtk_rc_clear_hash_node (gpointer key,
gpointer data,
gpointer user_data);
static void gtk_rc_clear_styles (void);
static GScannerConfig gtk_rc_scanner_config = static GScannerConfig gtk_rc_scanner_config =
@ -208,10 +226,10 @@ static GSList *widget_class_sets = NULL;
static gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS]; static gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS];
/* The files we have parsed, to reread later if necessary */ /* The files we have parsed, to reread later if necessary */
GSList *rc_files; GSList *rc_files = NULL;
void void
gtk_rc_init () gtk_rc_init (void)
{ {
rc_style_ht = g_hash_table_new ((GHashFunc) gtk_rc_style_hash, rc_style_ht = g_hash_table_new ((GHashFunc) gtk_rc_style_hash,
(GCompareFunc) gtk_rc_style_compare); (GCompareFunc) gtk_rc_style_compare);
@ -225,25 +243,88 @@ gtk_rc_parse_string (const gchar *rc_string)
gtk_rc_parse_any ("-", -1, rc_string); gtk_rc_parse_any ("-", -1, rc_string);
} }
void static void
gtk_rc_parse (const gchar *filename) gtk_rc_parse_file (const gchar *filename, gboolean reload)
{ {
gint fd; GtkRcFile *rc_file = NULL;
struct stat statbuf;
GSList *tmp_list;
g_return_if_fail (filename != NULL); g_return_if_fail (filename != NULL);
rc_files = g_slist_append (rc_files, g_strdup (filename)); tmp_list = rc_files;
while (tmp_list)
{
rc_file = tmp_list->data;
if (!strcmp (rc_file->name, filename))
break;
tmp_list = tmp_list->next;
}
fd = open (filename, O_RDONLY); if (!tmp_list)
if (fd < 0) {
return; rc_file = g_new (GtkRcFile, 1);
rc_file->name = g_strdup (filename);
rc_file->canonical_name = NULL;
rc_file->mtime = 0;
rc_file->reload = reload;
gtk_rc_parse_any (filename, fd, NULL); rc_files = g_slist_append (rc_files, rc_file);
}
close (fd); if (!rc_file->canonical_name)
{
/* Get the absolute pathname */
if (rc_file->name[0] == '/')
rc_file->canonical_name = rc_file->name;
else
{
GString *str;
gchar buffer[MAXPATHLEN];
#if defined(sun) && !defined(__SVR4)
if(!getwd(buffer))
#else
if(!getcwd(buffer, MAXPATHLEN))
#endif
return;
str = g_string_new (buffer);
g_string_append_c (str, '/');
g_string_append (str, rc_file->name);
rc_file->canonical_name = str->str;
g_string_free (str, FALSE);
}
}
if (!stat (rc_file->canonical_name, &statbuf))
{
gint fd;
rc_file->mtime = statbuf.st_mtime;
fd = open (rc_file->canonical_name, O_RDONLY);
if (fd < 0)
return;
gtk_rc_parse_any (filename, fd, NULL);
close (fd);
}
} }
void void
gtk_rc_parse (const gchar *filename)
{
g_return_if_fail (filename != NULL);
gtk_rc_parse_file (filename, TRUE);
}
static void
gtk_rc_clear_hash_node (gpointer key, gtk_rc_clear_hash_node (gpointer key,
gpointer data, gpointer data,
gpointer user_data) gpointer user_data)
@ -276,10 +357,10 @@ gtk_rc_clear_hash_node (gpointer key,
g_free (rc_style); g_free (rc_style);
} }
void static void
gtk_rc_reparse_all (void) gtk_rc_clear_styles (void)
{ {
GSList *tmp_list, *tmp_files; GSList *tmp_list;
GtkRcSet *rc_set; GtkRcSet *rc_set;
/* Clear out all old rc_styles */ /* Clear out all old rc_styles */
@ -312,22 +393,52 @@ gtk_rc_reparse_all (void)
g_slist_free (widget_class_sets); g_slist_free (widget_class_sets);
widget_class_sets = NULL; widget_class_sets = NULL;
/* Now read the RC's again */
gtk_rc_init (); gtk_rc_init ();
}
tmp_files = rc_files; gboolean
rc_files = NULL; gtk_rc_reparse_all (void)
{
GSList *tmp_list;
gboolean mtime_modified = FALSE;
GtkRcFile *rc_file;
tmp_list = tmp_files; struct stat statbuf;
/* Check through and see if any of the RC's have had their
* mtime modified. If so, reparse everything.
*/
tmp_list = rc_files;
while (tmp_list) while (tmp_list)
{ {
gtk_rc_parse ((gchar *)tmp_list->data); rc_file = tmp_list->data;
g_free (tmp_list->data);
if (!stat (rc_file->name, &statbuf) &&
(statbuf.st_mtime > rc_file->mtime))
{
mtime_modified = TRUE;
break;
}
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
g_slist_free (tmp_files);
if (mtime_modified)
{
gtk_rc_clear_styles();
tmp_list = rc_files;
while (tmp_list)
{
rc_file = tmp_list->data;
if (rc_file->reload)
gtk_rc_parse_file (rc_file->name, FALSE);
tmp_list = tmp_list->next;
}
}
return mtime_modified;
} }
GtkStyle* GtkStyle*
@ -680,7 +791,7 @@ gtk_rc_parse_statement (GScanner *scanner)
if (token != G_TOKEN_STRING) if (token != G_TOKEN_STRING)
return PARSE_ERROR; return PARSE_ERROR;
gtk_rc_parse (scanner->value.v_string); gtk_rc_parse_file (scanner->value.v_string, FALSE);
return PARSE_OK; return PARSE_OK;
} }

View File

@ -32,7 +32,7 @@ extern "C" {
void gtk_rc_init (void); void gtk_rc_init (void);
void gtk_rc_parse (const gchar *filename); void gtk_rc_parse (const gchar *filename);
void gtk_rc_parse_string (const gchar *rc_string); void gtk_rc_parse_string (const gchar *rc_string);
void gtk_rc_reparse_all (void); gboolean gtk_rc_reparse_all (void);
GtkStyle* gtk_rc_get_style (GtkWidget *widget); GtkStyle* gtk_rc_get_style (GtkWidget *widget);
void gtk_rc_add_widget_name_style (GtkStyle *style, void gtk_rc_add_widget_name_style (GtkStyle *style,
const gchar *pattern); const gchar *pattern);

View File

@ -41,7 +41,7 @@ static GtkRulerMetric ruler_metrics[] =
guint guint
gtk_ruler_get_type () gtk_ruler_get_type (void)
{ {
static guint ruler_type = 0; static guint ruler_type = 0;

View File

@ -33,7 +33,7 @@ static GtkRangeClass *parent_class = NULL;
guint guint
gtk_scale_get_type () gtk_scale_get_type (void)
{ {
static guint scale_type = 0; static guint scale_type = 0;

View File

@ -22,7 +22,7 @@ static void gtk_scrollbar_class_init (GtkScrollbarClass *klass);
static void gtk_scrollbar_init (GtkScrollbar *scrollbar); static void gtk_scrollbar_init (GtkScrollbar *scrollbar);
guint guint
gtk_scrollbar_get_type () gtk_scrollbar_get_type (void)
{ {
static guint scrollbar_type = 0; static guint scrollbar_type = 0;

View File

@ -52,7 +52,7 @@ static GtkContainerClass *parent_class = NULL;
guint guint
gtk_scrolled_window_get_type () gtk_scrolled_window_get_type (void)
{ {
static guint scrolled_window_type = 0; static guint scrolled_window_type = 0;

View File

@ -24,7 +24,7 @@ static void gtk_separator_init (GtkSeparator *separator);
guint guint
gtk_separator_get_type () gtk_separator_get_type (void)
{ {
static guint separator_type = 0; static guint separator_type = 0;

View File

@ -1026,7 +1026,7 @@ gtk_signal_set_funcs (GtkSignalMarshal marshal_func,
static void static void
gtk_signal_init () gtk_signal_init (void)
{ {
if (initialize) if (initialize)
{ {
@ -1066,7 +1066,7 @@ gtk_signal_info_compare (GtkSignalInfo *a,
} }
static GtkHandler* static GtkHandler*
gtk_signal_handler_new () gtk_signal_handler_new (void)
{ {
GtkHandler *handler; GtkHandler *handler;
@ -1371,7 +1371,7 @@ gtk_signal_connect_by_type (GtkObject *object,
} }
static GtkEmission* static GtkEmission*
gtk_emission_new () gtk_emission_new (void)
{ {
GtkEmission *emission; GtkEmission *emission;

View File

@ -89,7 +89,7 @@ static GtkWidgetClass *parent_class = NULL;
guint guint
gtk_spin_button_get_type () gtk_spin_button_get_type (void)
{ {
static guint spin_button_type = 0; static guint spin_button_type = 0;

View File

@ -48,7 +48,7 @@ static GtkContainerClass *parent_class;
static guint statusbar_signals[SIGNAL_LAST] = { 0 }; static guint statusbar_signals[SIGNAL_LAST] = { 0 };
guint guint
gtk_statusbar_get_type () gtk_statusbar_get_type (void)
{ {
static guint statusbar_type = 0; static guint statusbar_type = 0;
@ -157,7 +157,7 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
} }
GtkWidget* GtkWidget*
gtk_statusbar_new () gtk_statusbar_new (void)
{ {
return gtk_type_new (gtk_statusbar_get_type ()); return gtk_type_new (gtk_statusbar_get_type ());
} }

View File

@ -186,7 +186,7 @@ gtk_style_copy (GtkStyle *style)
} }
GtkStyle* GtkStyle*
gtk_style_new () gtk_style_new (void)
{ {
GtkStyle *style; GtkStyle *style;
gint i; gint i;
@ -607,7 +607,7 @@ gtk_style_init (GtkStyle *style)
} }
static void static void
gtk_styles_init () gtk_styles_init (void)
{ {
if (initialize) if (initialize)
{ {

Some files were not shown because too many files have changed in this diff Show More