+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.
(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
+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.
(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
+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.
(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
+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.
(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
+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.
(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
+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.
(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
+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.
(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
/* 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
/* 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
$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"
*/
gchar*
-gdk_set_locale ()
+gdk_set_locale (void)
{
if (!setlocale (LC_ALL,""))
g_print ("locale not supported by C library\n");
*/
gint
-gdk_events_pending ()
+gdk_events_pending (void)
{
gint result;
GList *tmp_list;
}
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;
}
*/
guint32
-gdk_time_get ()
+gdk_time_get (void)
{
struct timeval end;
struct timeval elapsed;
*/
guint32
-gdk_timer_get ()
+gdk_timer_get (void)
{
return timer_val;
}
}
void
-gdk_timer_enable ()
+gdk_timer_enable (void)
{
timerp = &timer;
}
void
-gdk_timer_disable ()
+gdk_timer_disable (void)
{
timerp = NULL;
}
*/
gint
-gdk_screen_width ()
+gdk_screen_width (void)
{
gint return_val;
*/
gint
-gdk_screen_height ()
+gdk_screen_height (void)
{
gint return_val;
}
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);
*--------------------------------------------------------------
*/
-void gdk_flush ()
+void gdk_flush (void)
{
XSync (gdk_display, False);
}
void
-gdk_beep ()
+gdk_beep (void)
{
XBell(gdk_display, 100);
}
*/
static gint
-gdk_event_wait ()
+gdk_event_wait (void)
{
GList *list;
GdkInput *input;
*/
static void
-gdk_exit_func ()
+gdk_exit_func (void)
{
static gboolean in_gdk_exit_func = FALSE;
void
-gdk_image_exit ()
+gdk_image_exit (void)
{
GdkImage *image;
}
void
-gdk_image_init ()
+gdk_image_init (void)
{
if (gdk_use_xshm)
{
#include "gdkinputgxi.h"
GList *
-gdk_input_list_devices ()
+gdk_input_list_devices (void)
{
return gdk_input_devices;
}
GdkModifierType *mask);
void
-gdk_input_init ()
+gdk_input_init (void)
{
gdk_input_vtable.set_mode = NULL;
gdk_input_vtable.set_axes = NULL;
/* 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,
}
static void
-gdk_input_check_proximity()
+gdk_input_check_proximity (void)
{
gint new_proximity = 0;
GList *tmp_list = gdk_input_devices;
{
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;
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);
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);
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] =
}
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]));
}
#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"
#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] =
{
}
void
-gdk_window_init ()
+gdk_window_init (void)
{
XWindowAttributes xattributes;
unsigned int width;
gdk_root_parent.width = width;
gdk_root_parent.height = height;
gdk_root_parent.children = NULL;
+ gdk_root_parent.colormap = NULL;
}
GdkWindow*
private->destroyed = FALSE;
private->extension_events = 0;
+ private->colormap = NULL;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
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,
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,
/*
* 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
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
}
void
-init_socket()
+init_socket(void)
{
struct sockaddr_in sin;
/* 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;
}
void
-init_xinput()
+init_xinput(void)
{
char **extensions;
XDeviceInfo *xdevices;
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
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
}
void
-handle_connection()
+handle_connection (void)
{
GxidMessage msg;
GxidU32 type;
- int length;
+ GxidU32 length;
GxidI32 retval;
int conn_fd;
/* 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);
}
void
-handle_xevent()
+handle_xevent(void)
{
int i;
XEvent event;
}
void
-usage()
+usage(void)
{
fprintf(stderr,"Usage: %s [-d display] [-p --gxid-port port]\n",
program_name);
}
if (FD_ISSET(socket_fd,&readfds))
- handle_connection(socket_fd);
+ handle_connection();
while (XPending(dpy))
handle_xevent();
void
-gdk_image_exit ()
+gdk_image_exit (void)
{
GdkImage *image;
}
void
-gdk_image_init ()
+gdk_image_init (void)
{
if (gdk_use_xshm)
{
GdkModifierType *mask);
void
-gdk_input_init ()
+gdk_input_init (void)
{
gdk_input_vtable.set_mode = NULL;
gdk_input_vtable.set_axes = NULL;
/* 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,
}
static void
-gdk_input_check_proximity()
+gdk_input_check_proximity (void)
{
gint new_proximity = 0;
GList *tmp_list = gdk_input_devices;
#include "gdkinputgxi.h"
GList *
-gdk_input_list_devices ()
+gdk_input_list_devices (void)
{
return gdk_input_devices;
}
*/
gchar*
-gdk_set_locale ()
+gdk_set_locale (void)
{
if (!setlocale (LC_ALL,""))
g_print ("locale not supported by C library\n");
*/
gint
-gdk_events_pending ()
+gdk_events_pending (void)
{
gint result;
GList *tmp_list;
}
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;
}
*/
guint32
-gdk_time_get ()
+gdk_time_get (void)
{
struct timeval end;
struct timeval elapsed;
*/
guint32
-gdk_timer_get ()
+gdk_timer_get (void)
{
return timer_val;
}
}
void
-gdk_timer_enable ()
+gdk_timer_enable (void)
{
timerp = &timer;
}
void
-gdk_timer_disable ()
+gdk_timer_disable (void)
{
timerp = NULL;
}
*/
gint
-gdk_screen_width ()
+gdk_screen_width (void)
{
gint return_val;
*/
gint
-gdk_screen_height ()
+gdk_screen_height (void)
{
gint return_val;
}
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);
*--------------------------------------------------------------
*/
-void gdk_flush ()
+void gdk_flush (void)
{
XSync (gdk_display, False);
}
void
-gdk_beep ()
+gdk_beep (void)
{
XBell(gdk_display, 100);
}
*/
static gint
-gdk_event_wait ()
+gdk_event_wait (void)
{
GList *list;
GdkInput *input;
*/
static void
-gdk_exit_func ()
+gdk_exit_func (void)
{
static gboolean in_gdk_exit_func = FALSE;
{
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;
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);
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);
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] =
}
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]));
}
#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"
#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] =
{
}
void
-gdk_window_init ()
+gdk_window_init (void)
{
XWindowAttributes xattributes;
unsigned int width;
gdk_root_parent.width = width;
gdk_root_parent.height = height;
gdk_root_parent.children = NULL;
+ gdk_root_parent.colormap = NULL;
}
GdkWindow*
private->destroyed = FALSE;
private->extension_events = 0;
+ private->colormap = NULL;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
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,
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,
/*
* 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
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
}
void
-init_socket()
+init_socket(void)
{
struct sockaddr_in sin;
/* 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;
}
void
-init_xinput()
+init_xinput(void)
{
char **extensions;
XDeviceInfo *xdevices;
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
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
}
void
-handle_connection()
+handle_connection (void)
{
GxidMessage msg;
GxidU32 type;
- int length;
+ GxidU32 length;
GxidI32 retval;
int conn_fd;
/* 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);
}
void
-handle_xevent()
+handle_xevent(void)
{
int i;
XEvent event;
}
void
-usage()
+usage(void)
{
fprintf(stderr,"Usage: %s [-d display] [-p --gxid-port port]\n",
program_name);
}
if (FD_ISSET(socket_fd,&readfds))
- handle_connection(socket_fd);
+ handle_connection();
while (XPending(dpy))
handle_xevent();
+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
GListAllocator*
-g_list_allocator_new ()
+g_list_allocator_new (void)
{
GRealListAllocator* allocator = g_new (GRealListAllocator, 1);
GList*
-g_list_alloc ()
+g_list_alloc (void)
{
GList *new_list;
void
-g_mem_profile ()
+g_mem_profile (void)
{
#ifdef MEM_PROFILE
gint i;
}
void
-g_mem_chunk_info ()
+g_mem_chunk_info (void)
{
GRealMemChunk *mem_chunk;
gint count;
}
void
-g_blow_chunks ()
+g_blow_chunks (void)
{
GRealMemChunk *mem_chunk;
GSList*
-g_slist_alloc ()
+g_slist_alloc (void)
{
GSList *new_list;
GTimer*
-g_timer_new ()
+g_timer_new (void)
{
GRealTimer *timer;
#include <string.h>
#include <locale.h>
#include <ctype.h> /* For tolower() */
+#include <unistd.h>
#include "glib.h"
{
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);
}
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 ();
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));
GtkAcceleratorTable*
-gtk_accelerator_table_new ()
+gtk_accelerator_table_new (void)
{
GtkAcceleratorTable *table;
GtkType
-gtk_adjustment_get_type ()
+gtk_adjustment_get_type (void)
{
static GtkType adjustment_type = 0;
}
}
-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)
{
guint
-gtk_alignment_get_type ()
+gtk_alignment_get_type (void)
{
static guint alignment_type = 0;
guint
-gtk_arrow_get_type ()
+gtk_arrow_get_type (void)
{
static guint arrow_type = 0;
#define MIN_RATIO 0.0001
guint
-gtk_aspect_frame_get_type ()
+gtk_aspect_frame_get_type (void)
{
static guint aspect_frame_type = 0;
guint
-gtk_button_box_get_type ()
+gtk_button_box_get_type (void)
{
static guint button_box_type = 0;
guint
-gtk_bin_get_type ()
+gtk_bin_get_type (void)
{
static guint bin_type = 0;
guint
-gtk_box_get_type ()
+gtk_box_get_type (void)
{
static guint box_type = 0;
ARG_0,
ARG_LABEL
};
-
+
static void gtk_button_class_init (GtkButtonClass *klass);
guint
-gtk_button_get_type ()
+gtk_button_get_type (void)
{
static guint button_type = 0;
{
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;
}
GtkWidget*
-gtk_button_new ()
+gtk_button_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_button_get_type ()));
}
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));
}
}
}
+/*
+ * +------------------------------------------------+
+ * | 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;
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);
+ }
}
}
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))
guint
-gtk_check_button_get_type ()
+gtk_check_button_get_type (void)
{
static guint check_button_type = 0;
}
GtkWidget*
-gtk_check_button_new ()
+gtk_check_button_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_check_button_get_type ()));
}
guint
-gtk_check_menu_item_get_type ()
+gtk_check_menu_item_get_type (void)
{
static guint check_menu_item_type = 0;
}
GtkWidget*
-gtk_check_menu_item_new ()
+gtk_check_menu_item_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_check_menu_item_get_type ()));
}
GtkType
-gtk_clist_get_type ()
+gtk_clist_get_type (void)
{
static GtkType clist_type = 0;
};
guint
-gtk_color_selection_get_type ()
+gtk_color_selection_get_type (void)
{
static guint color_selection_type = 0;
/***************************/
guint
-gtk_color_selection_dialog_get_type ()
+gtk_color_selection_dialog_get_type (void)
{
static guint color_selection_dialog_type = 0;
}
guint
-gtk_combo_get_type ()
+gtk_combo_get_type (void)
{
static guint combo_type = 0;
}
GtkWidget *
-gtk_combo_new ()
+gtk_combo_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_combo_get_type ()));
}
static guint hadjustment_key_id = 0;
GtkType
-gtk_container_get_type ()
+gtk_container_get_type (void)
{
static GtkType container_type = 0;
GtkType
-gtk_ctree_get_type ()
+gtk_ctree_get_type (void)
{
static GtkType ctree_type = 0;
guint
-gtk_data_get_type ()
+gtk_data_get_type (void)
{
static guint data_type = 0;
guint
-gtk_dialog_get_type ()
+gtk_dialog_get_type (void)
{
static guint dialog_type = 0;
}
GtkWidget*
-gtk_dialog_new ()
+gtk_dialog_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_dialog_get_type ()));
}
guint
-gtk_drawing_area_get_type ()
+gtk_drawing_area_get_type (void)
{
static guint drawing_area_type = 0;
GtkWidget*
-gtk_drawing_area_new ()
+gtk_drawing_area_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_drawing_area_get_type ()));
}
static GdkAtom clipboard_atom = GDK_NONE;
guint
-gtk_editable_get_type ()
+gtk_editable_get_type (void)
{
static guint editable_type = 0;
guint
-gtk_entry_get_type ()
+gtk_entry_get_type (void)
{
static guint entry_type = 0;
}
GtkWidget*
-gtk_entry_new ()
+gtk_entry_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_entry_get_type ()));
}
guint
-gtk_event_box_get_type ()
+gtk_event_box_get_type (void)
{
static guint event_box_type = 0;
}
GtkWidget*
-gtk_event_box_new ()
+gtk_event_box_new (void)
{
return GTK_WIDGET ( gtk_type_new (gtk_event_box_get_type ()));
}
static gint cmpl_errno;
guint
-gtk_file_selection_get_type ()
+gtk_file_selection_get_type (void)
{
static guint file_selection_type = 0;
guint
-gtk_fixed_get_type ()
+gtk_fixed_get_type (void)
{
static guint fixed_type = 0;
}
GtkWidget*
-gtk_fixed_new ()
+gtk_fixed_new (void)
{
GtkFixed *fixed;
guint
-gtk_frame_get_type ()
+gtk_frame_get_type (void)
{
static guint frame_type = 0;
static void
-gtk_gc_init ()
+gtk_gc_init (void)
{
initialize = FALSE;
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;
}
GtkWidget*
-gtk_hbutton_box_new ()
+gtk_hbutton_box_new (void)
{
GtkHButtonBox *hbutton_box;
guint
-gtk_hbox_get_type ()
+gtk_hbox_get_type (void)
{
static guint hbox_type = 0;
GdkEventMotion *event);
guint
-gtk_hpaned_get_type ()
+gtk_hpaned_get_type (void)
{
static guint hpaned_type = 0;
}
GtkWidget*
-gtk_hpaned_new ()
+gtk_hpaned_new (void)
{
GtkHPaned *hpaned;
guint
-gtk_hruler_get_type ()
+gtk_hruler_get_type (void)
{
static guint hruler_type = 0;
GtkWidget*
-gtk_hruler_new ()
+gtk_hruler_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_hruler_get_type ()));
}
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;
GtkTroughType *pos);
guint
-gtk_hscale_get_type ()
+gtk_hscale_get_type (void)
{
static guint hscale_type = 0;
guint
-gtk_hscrollbar_get_type ()
+gtk_hscrollbar_get_type (void)
{
static guint hscrollbar_type = 0;
guint
-gtk_hseparator_get_type ()
+gtk_hseparator_get_type (void)
{
static guint hseparator_type = 0;
}
GtkWidget*
-gtk_hseparator_new ()
+gtk_hseparator_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_hseparator_get_type ()));
}
guint
-gtk_image_get_type ()
+gtk_image_get_type (void)
{
static guint image_type = 0;
}
guint
-gtk_input_dialog_get_type ()
+gtk_input_dialog_get_type (void)
{
static guint input_dialog_type = 0;
GtkWidget *label;
GtkWidget *button;
- char buffer[16];
+ char buffer[32];
/* remove all the old items */
if (inputd->keys_list)
guint
-gtk_item_get_type ()
+gtk_item_get_type (void)
{
static guint item_type = 0;
guint
-gtk_label_get_type ()
+gtk_label_get_type (void)
{
static guint label_type = 0;
GtkType
-gtk_list_get_type ()
+gtk_list_get_type (void)
{
static guint list_type = 0;
}
GtkWidget*
-gtk_list_new ()
+gtk_list_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_list_get_type ()));
}
guint
-gtk_list_item_get_type ()
+gtk_list_item_get_type (void)
{
static guint list_item_type = 0;
}
GtkWidget*
-gtk_list_item_new ()
+gtk_list_item_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_list_item_get_type ()));
}
}
gchar*
-gtk_set_locale ()
+gtk_set_locale (void)
{
return gdk_set_locale ();
}
void
-gtk_main ()
+gtk_main (void)
{
GList *tmp_list;
GList *functions;
}
void
-gtk_main_quit ()
+gtk_main_quit (void)
{
iteration_done = TRUE;
}
}
gint
-gtk_main_iteration ()
+gtk_main_iteration (void)
{
return gtk_main_iteration_do (TRUE);
}
}
GdkEvent *
-gtk_get_current_event ()
+gtk_get_current_event (void)
{
if (current_events)
return gdk_event_copy ((GdkEvent *) current_events->data);
}
static void
-gtk_exit_func ()
+gtk_exit_func (void)
{
if (initialized)
{
}
static void
-gtk_handle_timeouts ()
+gtk_handle_timeouts (void)
{
guint32 the_time;
GList *tmp_list;
}
static void
-gtk_handle_current_idles ()
+gtk_handle_current_idles (void)
{
GList *tmp_list;
GList *tmp_list2;
}
static void
-gtk_handle_idle ()
+gtk_handle_idle (void)
{
/* Caller must already have called gtk_handle_current_idles if
* necessary
}
static void
-gtk_handle_timer ()
+gtk_handle_timer (void)
{
GtkTimeoutFunction *timeoutf;
guint
-gtk_menu_get_type ()
+gtk_menu_get_type (void)
{
static guint menu_type = 0;
}
GtkWidget*
-gtk_menu_new ()
+gtk_menu_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_menu_get_type ()));
}
guint
-gtk_menu_bar_get_type ()
+gtk_menu_bar_get_type (void)
{
static guint menu_bar_type = 0;
}
GtkWidget*
-gtk_menu_bar_new ()
+gtk_menu_bar_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_menu_bar_get_type ()));
}
guint
-gtk_menu_item_get_type ()
+gtk_menu_item_get_type (void)
{
static guint menu_item_type = 0;
}
GtkWidget*
-gtk_menu_item_new ()
+gtk_menu_item_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_menu_item_get_type ()));
}
guint
-gtk_menu_shell_get_type ()
+gtk_menu_shell_get_type (void)
{
static guint menu_shell_type = 0;
guint
-gtk_misc_get_type ()
+gtk_misc_get_type (void)
{
static guint misc_type = 0;
static guint notebook_signals[LAST_SIGNAL] = { 0 };
guint
-gtk_notebook_get_type ()
+gtk_notebook_get_type (void)
{
static guint notebook_type = 0;
}
GtkWidget*
-gtk_notebook_new ()
+gtk_notebook_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_notebook_get_type ()));
}
****************************************************/
void
-gtk_object_init_type ()
+gtk_object_init_type (void)
{
GtkType object_type = 0;
GtkTypeInfo object_info =
}
GtkType
-gtk_object_get_type ()
+gtk_object_get_type (void)
{
return GTK_TYPE_OBJECT;
}
}
static guint*
-gtk_object_data_id_alloc ()
+gtk_object_data_id_alloc (void)
{
static guint next_id = 1;
guint *ids;
guint
-gtk_option_menu_get_type ()
+gtk_option_menu_get_type (void)
{
static guint option_menu_type = 0;
}
GtkWidget*
-gtk_option_menu_new ()
+gtk_option_menu_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_option_menu_get_type ()));
}
guint
-gtk_paned_get_type ()
+gtk_paned_get_type (void)
{
static guint paned_type = 0;
static GtkWidgetClass *parent_class;
guint
-gtk_pixmap_get_type ()
+gtk_pixmap_get_type (void)
{
static guint pixmap_type = 0;
guint
-gtk_preview_get_type ()
+gtk_preview_get_type (void)
{
static guint preview_type = 0;
}
void
-gtk_preview_uninit ()
+gtk_preview_uninit (void)
{
GtkPreviewProp *prop;
GdkAtom property;
}
GdkVisual*
-gtk_preview_get_visual ()
+gtk_preview_get_visual (void)
{
if (!preview_class)
preview_class = gtk_type_class (gtk_preview_get_type ());
}
GdkColormap*
-gtk_preview_get_cmap ()
+gtk_preview_get_cmap (void)
{
if (!preview_class)
preview_class = gtk_type_class (gtk_preview_get_type ());
}
GtkPreviewInfo*
-gtk_preview_get_info ()
+gtk_preview_get_info (void)
{
if (!preview_class)
preview_class = gtk_type_class (gtk_preview_get_type ());
guint
-gtk_progress_bar_get_type ()
+gtk_progress_bar_get_type (void)
{
static guint progress_bar_type = 0;
GtkWidget*
-gtk_progress_bar_new ()
+gtk_progress_bar_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_progress_bar_get_type ()));
}
guint
-gtk_radio_button_get_type ()
+gtk_radio_button_get_type (void)
{
static guint radio_button_type = 0;
guint
-gtk_radio_menu_item_get_type ()
+gtk_radio_menu_item_get_type (void)
{
static guint radio_menu_item_type = 0;
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);
guint
-gtk_range_get_type ()
+gtk_range_get_type (void)
{
static guint range_type = 0;
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;
*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);
+ }
+ }
+}
*/
#include <ctype.h>
#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/param.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
typedef struct _GtkRcStyle GtkRcStyle;
typedef struct _GtkRcSet GtkRcSet;
typedef struct _GtkRcNode GtkRcNode;
+typedef struct _GtkRcFile GtkRcFile;
struct _GtkRcNode
{
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,
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);
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 =
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);
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;
+ }
+
+ 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;
+
+ rc_files = g_slist_append (rc_files, rc_file);
+ }
+
+ 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 (filename, O_RDONLY);
- if (fd < 0)
- return;
+ fd = open (rc_file->canonical_name, O_RDONLY);
+ if (fd < 0)
+ return;
- gtk_rc_parse_any (filename, fd, NULL);
+ gtk_rc_parse_any (filename, fd, NULL);
- close (fd);
+ 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)
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 */
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;
+
+ struct stat statbuf;
- tmp_list = tmp_files;
+ /* 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*
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;
}
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);
guint
-gtk_ruler_get_type ()
+gtk_ruler_get_type (void)
{
static guint ruler_type = 0;
guint
-gtk_scale_get_type ()
+gtk_scale_get_type (void)
{
static guint scale_type = 0;
static void gtk_scrollbar_init (GtkScrollbar *scrollbar);
guint
-gtk_scrollbar_get_type ()
+gtk_scrollbar_get_type (void)
{
static guint scrollbar_type = 0;
guint
-gtk_scrolled_window_get_type ()
+gtk_scrolled_window_get_type (void)
{
static guint scrolled_window_type = 0;
guint
-gtk_separator_get_type ()
+gtk_separator_get_type (void)
{
static guint separator_type = 0;
static void
-gtk_signal_init ()
+gtk_signal_init (void)
{
if (initialize)
{
}
static GtkHandler*
-gtk_signal_handler_new ()
+gtk_signal_handler_new (void)
{
GtkHandler *handler;
}
static GtkEmission*
-gtk_emission_new ()
+gtk_emission_new (void)
{
GtkEmission *emission;
guint
-gtk_spin_button_get_type ()
+gtk_spin_button_get_type (void)
{
static guint spin_button_type = 0;
static guint statusbar_signals[SIGNAL_LAST] = { 0 };
guint
-gtk_statusbar_get_type ()
+gtk_statusbar_get_type (void)
{
static guint statusbar_type = 0;
}
GtkWidget*
-gtk_statusbar_new ()
+gtk_statusbar_new (void)
{
return gtk_type_new (gtk_statusbar_get_type ());
}
}
GtkStyle*
-gtk_style_new ()
+gtk_style_new (void)
{
GtkStyle *style;
gint i;
}
static void
-gtk_styles_init ()
+gtk_styles_init (void)
{
if (initialize)
{
guint
-gtk_table_get_type ()
+gtk_table_get_type (void)
{
static guint table_type = 0;
/**********************************************************************/
guint
-gtk_text_get_type ()
+gtk_text_get_type (void)
{
static guint text_type = 0;
guint
-gtk_toggle_button_get_type ()
+gtk_toggle_button_get_type (void)
{
static guint toggle_button_type = 0;
GtkWidget*
-gtk_toggle_button_new ()
+gtk_toggle_button_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_toggle_button_get_type ()));
}
static const gchar *tooltips_data_key = "_GtkTooltipsData";
guint
-gtk_tooltips_get_type ()
+gtk_tooltips_get_type (void)
{
static guint tooltips_type = 0;
}
GtkTooltips *
-gtk_tooltips_new ()
+gtk_tooltips_new (void)
{
return gtk_type_new (gtk_tooltips_get_type ());
}
static guint tree_signals[LAST_SIGNAL] = { 0 };
guint
-gtk_tree_get_type ()
+gtk_tree_get_type (void)
{
static guint tree_type = 0;
}
GtkWidget*
-gtk_tree_new ()
+gtk_tree_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_tree_get_type ()));
}
static guint tree_item_signals[LAST_SIGNAL] = { 0 };
guint
-gtk_tree_item_get_type ()
+gtk_tree_item_get_type (void)
{
static guint tree_item_type = 0;
GtkWidget*
-gtk_tree_item_new ()
+gtk_tree_item_new (void)
{
GtkWidget *tree_item;
void
-gtk_type_init ()
+gtk_type_init (void)
{
if (initialize)
{
indent = old_indent;
}
+static gint type_isas[512];
+
+static void
+show_isas (void)
+{
+ int i;
+
+ for (i=0;i<512;i++)
+ if (type_isas[i])
+ g_print ("%s: %d\n",gtk_type_name(GTK_TYPE_MAKE(GTK_TYPE_OBJECT,i)),
+ type_isas[i]);
+}
+
gint
gtk_type_is_a (GtkType type,
GtkType is_a_type)
if (initialize)
gtk_type_init ();
+ type_isas[GTK_TYPE_SEQNO(is_a_type)]++;
+
node = g_hash_table_lookup (type_hash_table, &type);
while (node)
GtkType gtk_type_builtins[GTK_TYPE_NUM_BUILTINS];
static void
-gtk_type_init_builtin_types ()
+gtk_type_init_builtin_types (void)
{
/* GTK_TYPE_INVALID has typeid 0. The first type id returned by
gtk_type_unique is 1, which is GTK_TYPE_NONE. And so on. */
gtk_type_register_builtin (builtin_info[i].name,
builtin_info[i].parent);
}
+
+ ATEXIT(show_isas);
}
static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
guint
-gtk_vbutton_box_get_type ()
+gtk_vbutton_box_get_type (void)
{
static guint vbutton_box_type = 0;
}
GtkWidget*
-gtk_vbutton_box_new ()
+gtk_vbutton_box_new (void)
{
GtkVButtonBox *vbutton_box;
guint
-gtk_vbox_get_type ()
+gtk_vbox_get_type (void)
{
static guint vbox_type = 0;
static GtkBinClass *parent_class;
guint
-gtk_viewport_get_type ()
+gtk_viewport_get_type (void)
{
static guint viewport_type = 0;
GdkEventMotion *event);
guint
-gtk_vpaned_get_type ()
+gtk_vpaned_get_type (void)
{
static guint vpaned_type = 0;
}
GtkWidget*
-gtk_vpaned_new ()
+gtk_vpaned_new (void)
{
GtkVPaned *vpaned;
guint
-gtk_vruler_get_type ()
+gtk_vruler_get_type (void)
{
static guint vruler_type = 0;
}
GtkWidget*
-gtk_vruler_new ()
+gtk_vruler_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_vruler_get_type ()));
}
gfloat step_incr;
gfloat increment;
gfloat start, end, cur;
- gchar unit_str[12];
+ gchar unit_str[32];
gchar digit_str[2] = { '\0', '\0' };
gint text_height;
gint digit_height;
guint
-gtk_vscale_get_type ()
+gtk_vscale_get_type (void)
{
static guint vscale_type = 0;
GtkTroughType *pos);
guint
-gtk_vscrollbar_get_type ()
+gtk_vscrollbar_get_type (void)
{
static guint vscrollbar_type = 0;
guint
-gtk_vseparator_get_type ()
+gtk_vseparator_get_type (void)
{
static guint vseparator_type = 0;
}
GtkWidget*
-gtk_vseparator_new ()
+gtk_vseparator_new (void)
{
return GTK_WIDGET (gtk_type_new (gtk_vseparator_get_type ()));
}
*****************************************/
GtkType
-gtk_widget_get_type ()
+gtk_widget_get_type (void)
{
static GtkType widget_type = 0;
}
GtkStyle*
-gtk_widget_get_default_style ()
+gtk_widget_get_default_style (void)
{
if (!default_style)
{
}
static GtkStyle*
-gtk_widget_peek_style ()
+gtk_widget_peek_style (void)
{
if (style_stack)
return (GtkStyle*) style_stack->data;
}
void
-gtk_widget_pop_style ()
+gtk_widget_pop_style (void)
{
GSList *tmp;
*****************************************/
void
-gtk_widget_pop_colormap ()
+gtk_widget_pop_colormap (void)
{
GSList *tmp;
*****************************************/
void
-gtk_widget_pop_visual ()
+gtk_widget_pop_visual (void)
{
GSList *tmp;
*****************************************/
GdkColormap*
-gtk_widget_get_default_colormap ()
+gtk_widget_get_default_colormap (void)
{
if (!default_colormap)
default_colormap = gdk_colormap_get_system ();
*****************************************/
GdkVisual*
-gtk_widget_get_default_visual ()
+gtk_widget_get_default_visual (void)
{
if (!default_visual)
default_visual = gdk_visual_get_system ();
*****************************************/
static GdkColormap*
-gtk_widget_peek_colormap ()
+gtk_widget_peek_colormap (void)
{
if (colormap_stack)
return (GdkColormap*) colormap_stack->data;
*****************************************/
static GdkVisual*
-gtk_widget_peek_visual ()
+gtk_widget_peek_visual (void)
{
if (visual_stack)
return (GdkVisual*) visual_stack->data;
*****************************************/
static GtkWidgetAuxInfo*
-gtk_widget_aux_info_new ()
+gtk_widget_aux_info_new (void)
{
GtkWidgetAuxInfo *aux_info;
guint
-gtk_window_get_type ()
+gtk_window_get_type (void)
{
static guint window_type = 0;
void
-hello ()
+hello (void)
{
g_print ("hello world\n");
}
}
static void
-create_buttons ()
+create_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_toggle_buttons ()
+create_toggle_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_check_buttons ()
+create_check_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_radio_buttons ()
+create_radio_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-test_hbbox ()
+test_hbbox (void)
{
create_bbox_window (TRUE, "Spread", 50, 40, 85, 28, GTK_BUTTONBOX_SPREAD);
create_bbox_window (TRUE, "Edge", 200, 40, 85, 25, GTK_BUTTONBOX_EDGE);
}
static void
-test_vbbox ()
+test_vbbox (void)
{
create_bbox_window (FALSE, "Spread", 50, 40, 85, 25, GTK_BUTTONBOX_SPREAD);
create_bbox_window (FALSE, "Edge", 250, 40, 85, 28, GTK_BUTTONBOX_EDGE);
}
static void
-create_button_box ()
+create_button_box (void)
{
static GtkWidget* window = NULL;
GtkWidget* bbox;
}
static void
-create_statusbar ()
+create_statusbar (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
/* end of function used by tree demos */
static void
-create_handle_box ()
+create_handle_box (void)
{
static GtkWidget* window = NULL;
GtkWidget *handle_box;
}
static void
-create_reparent ()
+create_reparent (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_pixmap ()
+create_pixmap (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_tooltips ()
+create_tooltips (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_menus ()
+create_menus (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
* GtkScrolledWindow
*/
static void
-create_scrolled_windows ()
+create_scrolled_windows (void)
{
static GtkWidget *window;
GtkWidget *scrolled_window;
}
static void
-create_entry ()
+create_entry (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_spins ()
+create_spins (void)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
}
static void
-create_cursors ()
+create_cursors (void)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
}
static void
-create_list ()
+create_list (void)
{
static GtkWidget *window = NULL;
static char *list_items[] =
}
static void
-create_clist ()
+create_clist (void)
{
gint i;
static GtkWidget *window = NULL;
after_press (ctree, NULL);
}
-void create_ctree ()
+void create_ctree (void)
{
static GtkWidget *window = NULL;
GtkTooltips *tooltips;
}
void
-create_color_selection ()
+create_color_selection (void)
{
static GtkWidget *window = NULL;
}
void
-create_file_selection ()
+create_file_selection (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_dialog ()
+create_dialog (void)
{
static GtkWidget *label;
GtkWidget *button;
* GtkRange
*/
void
-create_range_controls ()
+create_range_controls (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
* GtkRulers
*/
void
-create_rulers ()
+create_rulers (void)
{
static GtkWidget *window = NULL;
GtkWidget *table;
* GtkText
*/
void
-create_text ()
+create_text (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_notebook ()
+create_notebook (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
* GtkPanes
*/
void
-create_panes ()
+create_panes (void)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
}
void
-create_dnd ()
+create_dnd (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
void
-create_shapes ()
+create_shapes (void)
{
/* Variables used by the Drag/Drop and Shape Window demos */
static GtkWidget *modeller = NULL;
}
void
-create_wmhints ()
+create_wmhints (void)
{
static GtkWidget *window = NULL;
GtkWidget *label;
}
void
-create_progress_bar ()
+create_progress_bar (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_color_preview ()
+create_color_preview (void)
{
static GtkWidget *window = NULL;
GtkWidget *preview;
}
void
-create_gray_preview ()
+create_gray_preview (void)
{
static GtkWidget *window = NULL;
GtkWidget *preview;
}
void
-create_selection_test ()
+create_selection_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
* Gamma Curve
*/
void
-create_gamma_curve ()
+create_gamma_curve (void)
{
static GtkWidget *window = NULL, *curve;
static int count = 0;
void
-create_scroll_test ()
+create_scroll_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *hbox;
}
void
-create_timeout_test ()
+create_timeout_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_idle_test ()
+create_idle_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
{
GList *toplevels;
- gtk_rc_reparse_all ();
-
- toplevels = gdk_window_get_toplevels();
- while (toplevels)
+ if (gtk_rc_reparse_all ())
{
- GtkWidget *widget;
- gdk_window_get_user_data (toplevels->data, (gpointer *)&widget);
-
- if (widget)
- gtk_widget_reset_rc_styles (widget);
-
- toplevels = toplevels->next;
+ toplevels = gdk_window_get_toplevels();
+ while (toplevels)
+ {
+ GtkWidget *widget;
+ gdk_window_get_user_data (toplevels->data, (gpointer *)&widget);
+
+ if (widget)
+ gtk_widget_reset_rc_styles (widget);
+
+ toplevels = toplevels->next;
+ }
+ g_list_free (toplevels);
}
-
- g_list_free (toplevels);
}
void
-create_rc_file ()
+create_rc_file (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_mainloop ()
+create_mainloop (void)
{
static GtkWidget *window = NULL;
GtkWidget *label;
}
void
-create_main_window ()
+create_main_window (void)
{
struct {
char *label;
/* Check to see if we need to draw a cursor for current device */
static void
-check_cursor ()
+check_cursor (void)
{
GList *tmp_list;
}
void
-create_input_dialog ()
+create_input_dialog (void)
{
static GtkWidget *inputd = NULL;
}
void
-quit ()
+quit (void)
{
gtk_exit (0);
}
GString *selection_string = NULL;
static void
-init_atoms ()
+init_atoms (void)
{
int i;
}
void
-quit ()
+quit (void)
{
gtk_exit (0);
}
void
-hello ()
+hello (void)
{
g_print ("hello world\n");
}
}
static void
-create_buttons ()
+create_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_toggle_buttons ()
+create_toggle_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_check_buttons ()
+create_check_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_radio_buttons ()
+create_radio_buttons (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-test_hbbox ()
+test_hbbox (void)
{
create_bbox_window (TRUE, "Spread", 50, 40, 85, 28, GTK_BUTTONBOX_SPREAD);
create_bbox_window (TRUE, "Edge", 200, 40, 85, 25, GTK_BUTTONBOX_EDGE);
}
static void
-test_vbbox ()
+test_vbbox (void)
{
create_bbox_window (FALSE, "Spread", 50, 40, 85, 25, GTK_BUTTONBOX_SPREAD);
create_bbox_window (FALSE, "Edge", 250, 40, 85, 28, GTK_BUTTONBOX_EDGE);
}
static void
-create_button_box ()
+create_button_box (void)
{
static GtkWidget* window = NULL;
GtkWidget* bbox;
}
static void
-create_statusbar ()
+create_statusbar (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
/* end of function used by tree demos */
static void
-create_handle_box ()
+create_handle_box (void)
{
static GtkWidget* window = NULL;
GtkWidget *handle_box;
}
static void
-create_reparent ()
+create_reparent (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_pixmap ()
+create_pixmap (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_tooltips ()
+create_tooltips (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_menus ()
+create_menus (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
* GtkScrolledWindow
*/
static void
-create_scrolled_windows ()
+create_scrolled_windows (void)
{
static GtkWidget *window;
GtkWidget *scrolled_window;
}
static void
-create_entry ()
+create_entry (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_spins ()
+create_spins (void)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
}
static void
-create_cursors ()
+create_cursors (void)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
}
static void
-create_list ()
+create_list (void)
{
static GtkWidget *window = NULL;
static char *list_items[] =
}
static void
-create_clist ()
+create_clist (void)
{
gint i;
static GtkWidget *window = NULL;
after_press (ctree, NULL);
}
-void create_ctree ()
+void create_ctree (void)
{
static GtkWidget *window = NULL;
GtkTooltips *tooltips;
}
void
-create_color_selection ()
+create_color_selection (void)
{
static GtkWidget *window = NULL;
}
void
-create_file_selection ()
+create_file_selection (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_dialog ()
+create_dialog (void)
{
static GtkWidget *label;
GtkWidget *button;
* GtkRange
*/
void
-create_range_controls ()
+create_range_controls (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
* GtkRulers
*/
void
-create_rulers ()
+create_rulers (void)
{
static GtkWidget *window = NULL;
GtkWidget *table;
* GtkText
*/
void
-create_text ()
+create_text (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
static void
-create_notebook ()
+create_notebook (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
* GtkPanes
*/
void
-create_panes ()
+create_panes (void)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
}
void
-create_dnd ()
+create_dnd (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
}
void
-create_shapes ()
+create_shapes (void)
{
/* Variables used by the Drag/Drop and Shape Window demos */
static GtkWidget *modeller = NULL;
}
void
-create_wmhints ()
+create_wmhints (void)
{
static GtkWidget *window = NULL;
GtkWidget *label;
}
void
-create_progress_bar ()
+create_progress_bar (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_color_preview ()
+create_color_preview (void)
{
static GtkWidget *window = NULL;
GtkWidget *preview;
}
void
-create_gray_preview ()
+create_gray_preview (void)
{
static GtkWidget *window = NULL;
GtkWidget *preview;
}
void
-create_selection_test ()
+create_selection_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
* Gamma Curve
*/
void
-create_gamma_curve ()
+create_gamma_curve (void)
{
static GtkWidget *window = NULL, *curve;
static int count = 0;
void
-create_scroll_test ()
+create_scroll_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *hbox;
}
void
-create_timeout_test ()
+create_timeout_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_idle_test ()
+create_idle_test (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
{
GList *toplevels;
- gtk_rc_reparse_all ();
-
- toplevels = gdk_window_get_toplevels();
- while (toplevels)
+ if (gtk_rc_reparse_all ())
{
- GtkWidget *widget;
- gdk_window_get_user_data (toplevels->data, (gpointer *)&widget);
-
- if (widget)
- gtk_widget_reset_rc_styles (widget);
-
- toplevels = toplevels->next;
+ toplevels = gdk_window_get_toplevels();
+ while (toplevels)
+ {
+ GtkWidget *widget;
+ gdk_window_get_user_data (toplevels->data, (gpointer *)&widget);
+
+ if (widget)
+ gtk_widget_reset_rc_styles (widget);
+
+ toplevels = toplevels->next;
+ }
+ g_list_free (toplevels);
}
-
- g_list_free (toplevels);
}
void
-create_rc_file ()
+create_rc_file (void)
{
static GtkWidget *window = NULL;
GtkWidget *button;
}
void
-create_mainloop ()
+create_mainloop (void)
{
static GtkWidget *window = NULL;
GtkWidget *label;
}
void
-create_main_window ()
+create_main_window (void)
{
struct {
char *label;
/* Check to see if we need to draw a cursor for current device */
static void
-check_cursor ()
+check_cursor (void)
{
GList *tmp_list;
}
void
-create_input_dialog ()
+create_input_dialog (void)
{
static GtkWidget *inputd = NULL;
}
void
-quit ()
+quit (void)
{
gtk_exit (0);
}
GString *selection_string = NULL;
static void
-init_atoms ()
+init_atoms (void)
{
int i;
}
void
-quit ()
+quit (void)
{
gtk_exit (0);
}