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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* 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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* 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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* 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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* 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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* 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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* 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>
* gtk/gtkadjustment.c (gtk_adjustment_assimilate_value): new function
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
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"
signal.
>>>>>>> 1.372
Fri May 1 12:28:35 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtkcombo.c: Further changes to the way the window

View File

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

View File

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

View File

@ -118,6 +118,14 @@ if test "x$enable_shm" = "xyes"; then
$x_libs)
fi
# Check for shaped window extension
AC_CHECK_LIB(Xext, XShapeCombineMask,
if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
$x_libs="-lXext $x_libs"
fi
AC_DEFINE(HAVE_SHAPE_EXT))
x_cflags="$X_CFLAGS"
x_ldflags="$X_LDFLAGS $X_LIBS"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -256,8 +256,14 @@ gdk_pixmap_read_string (FILE *infile,
{
if (cnt == (*buffer_size))
{
(*buffer_size) *= 2;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size); }
guint new_size = (*buffer_size) * 2;
if (new_size > (*buffer_size))
*buffer_size = new_size;
else
return FALSE;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size);
}
if (c != '"')
(*buffer)[cnt++] = c;
@ -399,6 +405,11 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
gdk_pixmap_read_string (infile, &buffer, &buffer_size);
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);
@ -574,6 +585,11 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
i = 0;
buffer = data[i++];
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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -256,8 +256,14 @@ gdk_pixmap_read_string (FILE *infile,
{
if (cnt == (*buffer_size))
{
(*buffer_size) *= 2;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size); }
guint new_size = (*buffer_size) * 2;
if (new_size > (*buffer_size))
*buffer_size = new_size;
else
return FALSE;
(*buffer) = (gchar *) g_realloc ((*buffer), *buffer_size);
}
if (c != '"')
(*buffer)[cnt++] = c;
@ -399,6 +405,11 @@ gdk_pixmap_colormap_create_from_xpm (GdkWindow *window,
gdk_pixmap_read_string (infile, &buffer, &buffer_size);
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);
@ -574,6 +585,11 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window,
i = 0;
buffer = data[i++];
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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -22,6 +22,7 @@
#include <string.h>
#include <locale.h>
#include <ctype.h> /* For tolower() */
#include <unistd.h>
#include "glib.h"
@ -675,7 +676,14 @@ g_error (gchar *format, ...)
{
va_list args, args2;
char *buf;
static gboolean errored = 0;
if (errored++)
{
write (2, "g_error: recursed!\n", 19);
return;
}
va_start (args, format);
va_start (args2, format);
buf = g_vsprintf (format, &args, &args2);
@ -688,9 +696,10 @@ g_error (gchar *format, ...)
}
else
{
fputs ("\n** ERROR **: ", stderr);
fputs (buf, stderr);
fputc ('\n', stderr);
/* Use write() here because we might be out of memory */
write (2, "\n** ERROR **: ", 14);
write (2, buf, strlen(buf));
write (2, "\n", 1);
}
abort ();
@ -855,9 +864,14 @@ g_strcasecmp (const gchar *s1, const gchar *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)
return (c1 - c2);
s1++; s2++;
}
return (((gint)(guchar) *s1) - ((gint)(guchar) *s2));

View File

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

View File

@ -35,7 +35,7 @@ static guint adjustment_signals[LAST_SIGNAL] = { 0 };
GtkType
gtk_adjustment_get_type ()
gtk_adjustment_get_type (void)
{
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
gtk_adjustment_changed (GtkAdjustment *adjustment)
{

View File

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

View File

@ -29,7 +29,7 @@ static gint gtk_arrow_expose (GtkWidget *widget,
guint
gtk_arrow_get_type ()
gtk_arrow_get_type (void)
{
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
guint
gtk_aspect_frame_get_type ()
gtk_aspect_frame_get_type (void)
{
static guint aspect_frame_type = 0;

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@ enum {
ARG_0,
ARG_LABEL
};
static void gtk_button_class_init (GtkButtonClass *klass);
@ -94,7 +94,7 @@ static guint button_signals[LAST_SIGNAL] = { 0 };
guint
gtk_button_get_type ()
gtk_button_get_type (void)
{
static guint button_type = 0;
@ -219,16 +219,16 @@ gtk_button_set_arg (GtkButton *button,
{
case ARG_LABEL:
gtk_container_disable_resize (GTK_CONTAINER (button));
if (button->child)
{
gtk_widget_unparent (button->child);
button->child = NULL;
}
label = gtk_label_new (GTK_VALUE_STRING(*arg));
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (button), label);
gtk_container_enable_resize (GTK_CONTAINER (button));
break;
@ -239,7 +239,7 @@ gtk_button_set_arg (GtkButton *button,
}
GtkWidget*
gtk_button_new ()
gtk_button_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_button_get_type ()));
}
@ -433,9 +433,9 @@ gtk_button_size_allocate (GtkWidget *widget,
DEFAULT_LEFT_POS);
child_allocation.y += (GTK_WIDGET (widget)->style->klass->ythickness +
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));
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));
}
@ -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
gtk_button_paint (GtkWidget *widget,
GdkRectangle *area)
{
GdkRectangle restrict_area;
GdkRectangle outer_area;
GdkRectangle tmp_area;
GdkRectangle new_area;
gint xthickness;
gint ythickness;
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BUTTON (widget));
xthickness = widget->style->klass->xthickness;
ythickness = widget->style->klass->ythickness;
if (GTK_WIDGET_DRAWABLE (widget))
{
restrict_area.x = GTK_WIDGET (widget)->style->klass->xthickness;
restrict_area.y = GTK_WIDGET (widget)->style->klass->ythickness;
restrict_area.width = GTK_WIDGET (widget)->allocation.width -
restrict_area.x = xthickness;
restrict_area.y = ythickness;
restrict_area.width = GTK_WIDGET (widget)->allocation.width -
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;
outer_area = restrict_area;
if (GTK_WIDGET_CAN_DEFAULT (widget))
{
restrict_area.x += DEFAULT_LEFT_POS;
@ -477,6 +512,49 @@ gtk_button_paint (GtkWidget *widget,
new_area.x, new_area.y,
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) &&
!GTK_WIDGET_REALIZED (widget))
gtk_widget_realize (widget);
if (GTK_WIDGET_MAPPED (widget->parent) &&
!GTK_WIDGET_MAPPED (widget))
gtk_widget_map (widget);
}
button->child = widget;
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container))

View File

@ -47,7 +47,7 @@ static GtkToggleButtonClass *parent_class = NULL;
guint
gtk_check_button_get_type ()
gtk_check_button_get_type (void)
{
static guint check_button_type = 0;
@ -96,7 +96,7 @@ gtk_check_button_init (GtkCheckButton *check_button)
}
GtkWidget*
gtk_check_button_new ()
gtk_check_button_new (void)
{
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
gtk_check_menu_item_get_type ()
gtk_check_menu_item_get_type (void)
{
static guint check_menu_item_type = 0;
@ -72,7 +72,7 @@ gtk_check_menu_item_get_type ()
}
GtkWidget*
gtk_check_menu_item_new ()
gtk_check_menu_item_new (void)
{
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
gtk_clist_get_type ()
gtk_clist_get_type (void)
{
static GtkType clist_type = 0;

View File

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

View File

@ -671,7 +671,7 @@ gtk_combo_init (GtkCombo * combo)
}
guint
gtk_combo_get_type ()
gtk_combo_get_type (void)
{
static guint combo_type = 0;
@ -693,7 +693,7 @@ gtk_combo_get_type ()
}
GtkWidget *
gtk_combo_new ()
gtk_combo_new (void)
{
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;
GtkType
gtk_container_get_type ()
gtk_container_get_type (void)
{
static GtkType container_type = 0;

View File

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

View File

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

View File

@ -28,7 +28,7 @@ static void gtk_dialog_init (GtkDialog *dialog);
guint
gtk_dialog_get_type ()
gtk_dialog_get_type (void)
{
static guint dialog_type = 0;
@ -76,7 +76,7 @@ gtk_dialog_init (GtkDialog *dialog)
}
GtkWidget*
gtk_dialog_new ()
gtk_dialog_new (void)
{
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
gtk_drawing_area_get_type ()
gtk_drawing_area_get_type (void)
{
static guint drawing_area_type = 0;
@ -72,7 +72,7 @@ gtk_drawing_area_init (GtkDrawingArea *darea)
GtkWidget*
gtk_drawing_area_new ()
gtk_drawing_area_new (void)
{
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;
guint
gtk_editable_get_type ()
gtk_editable_get_type (void)
{
static guint editable_type = 0;

View File

@ -181,7 +181,7 @@ static GtkTextFunction alt_keys[26] =
guint
gtk_entry_get_type ()
gtk_entry_get_type (void)
{
static guint entry_type = 0;
@ -267,7 +267,7 @@ gtk_entry_init (GtkEntry *entry)
}
GtkWidget*
gtk_entry_new ()
gtk_entry_new (void)
{
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
gtk_event_box_get_type ()
gtk_event_box_get_type (void)
{
static guint event_box_type = 0;
@ -79,7 +79,7 @@ gtk_event_box_init (GtkEventBox *event_box)
}
GtkWidget*
gtk_event_box_new ()
gtk_event_box_new (void)
{
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;
guint
gtk_file_selection_get_type ()
gtk_file_selection_get_type (void)
{
static guint file_selection_type = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -66,7 +66,7 @@ static const gchar *attach_data_key = "gtk-menu-attach-data";
guint
gtk_menu_get_type ()
gtk_menu_get_type (void)
{
static guint menu_type = 0;
@ -244,7 +244,7 @@ gtk_menu_detach (GtkMenu *menu)
}
GtkWidget*
gtk_menu_new ()
gtk_menu_new (void)
{
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
gtk_menu_bar_get_type ()
gtk_menu_bar_get_type (void)
{
static guint menu_bar_type = 0;
@ -85,7 +85,7 @@ gtk_menu_bar_init (GtkMenuBar *menu_bar)
}
GtkWidget*
gtk_menu_bar_new ()
gtk_menu_bar_new (void)
{
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
gtk_menu_item_get_type ()
gtk_menu_item_get_type (void)
{
static guint menu_item_type = 0;
@ -159,7 +159,7 @@ gtk_menu_item_init (GtkMenuItem *menu_item)
}
GtkWidget*
gtk_menu_item_new ()
gtk_menu_item_new (void)
{
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
gtk_menu_shell_get_type ()
gtk_menu_shell_get_type (void)
{
static guint menu_shell_type = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,6 +54,9 @@ static gint gtk_range_focus_in (GtkWidget *widget,
GdkEventFocus *event);
static gint gtk_range_focus_out (GtkWidget *widget,
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_slider (GtkRange *range);
static gint gtk_real_range_timer (GtkRange *range);
@ -79,7 +82,7 @@ static GtkWidgetClass *parent_class = NULL;
guint
gtk_range_get_type ()
gtk_range_get_type (void)
{
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->focus_in_event = gtk_range_focus_in;
widget_class->focus_out_event = gtk_range_focus_out;
widget_class->style_set = gtk_range_style_set;
class->slider_width = 11;
class->stepper_size = 11;
@ -1455,3 +1459,39 @@ gtk_range_trough_vdims (GtkRange *range,
*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 <unistd.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
@ -64,6 +66,7 @@ enum {
typedef struct _GtkRcStyle GtkRcStyle;
typedef struct _GtkRcSet GtkRcSet;
typedef struct _GtkRcNode GtkRcNode;
typedef struct _GtkRcFile GtkRcFile;
struct _GtkRcNode
{
@ -87,6 +90,13 @@ struct _GtkRcSet
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 gint gtk_rc_style_compare (const char *a,
@ -98,6 +108,9 @@ static gint gtk_rc_style_match (const char *set,
const char *path);
static GtkStyle* gtk_rc_style_init (GtkRcStyle *rc_style,
GdkColormap *cmap);
static void gtk_rc_parse_file (const gchar *filename,
gboolean reload);
static void gtk_rc_parse_any (const gchar *input_name,
gint input_fd,
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 char* gtk_rc_widget_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 =
@ -208,10 +226,10 @@ static GSList *widget_class_sets = NULL;
static gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS];
/* The files we have parsed, to reread later if necessary */
GSList *rc_files;
GSList *rc_files = NULL;
void
gtk_rc_init ()
gtk_rc_init (void)
{
rc_style_ht = g_hash_table_new ((GHashFunc) gtk_rc_style_hash,
(GCompareFunc) gtk_rc_style_compare);
@ -225,25 +243,88 @@ gtk_rc_parse_string (const gchar *rc_string)
gtk_rc_parse_any ("-", -1, rc_string);
}
void
gtk_rc_parse (const gchar *filename)
static void
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);
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 (fd < 0)
return;
if (!tmp_list)
{
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
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,
gpointer data,
gpointer user_data)
@ -276,10 +357,10 @@ gtk_rc_clear_hash_node (gpointer key,
g_free (rc_style);
}
void
gtk_rc_reparse_all (void)
static void
gtk_rc_clear_styles (void)
{
GSList *tmp_list, *tmp_files;
GSList *tmp_list;
GtkRcSet *rc_set;
/* Clear out all old rc_styles */
@ -312,22 +393,52 @@ gtk_rc_reparse_all (void)
g_slist_free (widget_class_sets);
widget_class_sets = NULL;
/* Now read the RC's again */
gtk_rc_init ();
}
tmp_files = rc_files;
rc_files = NULL;
gboolean
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)
{
gtk_rc_parse ((gchar *)tmp_list->data);
g_free (tmp_list->data);
rc_file = tmp_list->data;
if (!stat (rc_file->name, &statbuf) &&
(statbuf.st_mtime > rc_file->mtime))
{
mtime_modified = TRUE;
break;
}
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*
@ -680,7 +791,7 @@ gtk_rc_parse_statement (GScanner *scanner)
if (token != G_TOKEN_STRING)
return PARSE_ERROR;
gtk_rc_parse (scanner->value.v_string);
gtk_rc_parse_file (scanner->value.v_string, FALSE);
return PARSE_OK;
}

View File

@ -32,7 +32,7 @@ extern "C" {
void gtk_rc_init (void);
void gtk_rc_parse (const gchar *filename);
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);
void gtk_rc_add_widget_name_style (GtkStyle *style,
const gchar *pattern);

View File

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

View File

@ -33,7 +33,7 @@ static GtkRangeClass *parent_class = NULL;
guint
gtk_scale_get_type ()
gtk_scale_get_type (void)
{
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);
guint
gtk_scrollbar_get_type ()
gtk_scrollbar_get_type (void)
{
static guint scrollbar_type = 0;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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