Commit b52b326d authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Add GdkEventSetting event for notification of changes to system settings,

Mon Apr  2 18:18:07 2001  Owen Taylor  <otaylor@redhat.com>

        * gdk/gdkevents.h: Add GdkEventSetting event for notification
	of changes to system settings, gdk_setting_get() to retrieve
	a single system setting.

	* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
	to the draft XSETTINGS mechanism.

	* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
	XSETTINGS.

	* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
	of GDK settings changes to the GtkSettings object.

	* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
	double-click-timeout property to GDK.

	* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
	Define GDK boxed types here.

	* gdk/Makefile.am gdk/makeenums.pl: Generate source files
	gdk/gdkenumtypes.[ch] for enum definitions.

	* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
	* gtk/gtk-boxed.defs: Comment out GDK types
	* gtk/gtktypeutils.h: Remove GDK types
	* gtk/Makefile.am: No longer scan GDK headers for enumerataions
parent 0aef43bc
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
Mon Apr 2 18:18:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkevents.h: Add GdkEventSetting event for notification
of changes to system settings, gdk_setting_get() to retrieve
a single system setting.
* gdk/x11/gdkevents-x11.c: Bridge gdk_setting_get() and GdkEventSetting
to the draft XSETTINGS mechanism.
* gdk/x11/xsettings-{common,client}.[ch]: Sample-implementation of
XSETTINGS.
* gtk/gtkmain.c gtk/gtksettings.[ch]: Propagate notification
of GDK settings changes to the GtkSettings object.
* gdk/gdkevents.[ch] gdk/gtk/gtksettings.c: Hook up the
double-click-timeout property to GDK.
* gdk/gdkcolor.[ch] gdk/gdkvisual.h gdk/gdkevent.[ch] gdk/gdkfont.[ch]:
Define GDK boxed types here.
* gdk/Makefile.am gdk/makeenums.pl: Generate source files
gdk/gdkenumtypes.[ch] for enum definitions.
* gtk/gtkcompat.h: Add defines for GTK_TYPE_GDK_*
* gtk/gtk-boxed.defs: Comment out GDK types
* gtk/gtktypeutils.h: Remove GDK types
* gtk/Makefile.am: No longer scan GDK headers for enumerataions
Mon Apr 2 16:41:08 2001 Owen Taylor <otaylor@redhat.com>
* Applied patch from Ron Steinke to add signal accumulators
......
......@@ -68,7 +68,6 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
gdkpango.h \
gdkpixbuf.h \
gdkpixmap.h \
gdkprivate.h \
gdkproperty.h \
gdkregion.h \
gdkrgb.h \
......@@ -78,6 +77,12 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
gdkwindow.h \
@STRIP_END@
gdk_headers = @STRIP_BEGIN@ \
$(gdk_public_h_sources) \
gdkenumtypes.h \
gdkprivate.h \
@STRIP_END@
gdk_c_sources = @STRIP_BEGIN@ \
gdk.c \
gdkcolor.c \
......@@ -115,8 +120,8 @@ libgdk_x11_includedir = $(includedir)/gtk-2.0/gdk
libgdk_x11_1_3_la_LIBADD = \
$(gtarget)/libgdk-$(gtarget).la
libgdk_x11_include_HEADERS = $(gdk_public_h_sources)
libgdk_x11_1_3_la_SOURCES = $(gdk_c_sources)
libgdk_x11_include_HEADERS = $(gdk_headers)
libgdk_x11_1_3_la_SOURCES = $(gdk_c_sources) gdkenumtypes.c
endif
if USE_NANOX
......@@ -125,8 +130,8 @@ libgdk_nanox_includedir = $(includedir)/gtk-2.0/gdk
libgdk_nanox_1_3_la_LIBADD = \
$(gtarget)/libgdk-$(gtarget).la
libgdk_nanox_include_HEADERS = $(gdk_public_h_sources)
libgdk_nanox_1_3_la_SOURCES = $(gdk_c_sources)
libgdk_nanox_include_HEADERS = $(gdk_headers)
libgdk_nanox_1_3_la_SOURCES = $(gdk_c_sources) gdkenumtypes.c
endif
if USE_LINUX_FB
......@@ -135,8 +140,8 @@ libgdk_linux_fb_includedir = $(includedir)/gtk-2.0/gdk
libgdk_linux_fb_1_3_la_LIBADD = \
$(gtarget)/libgdk-$(gtarget).la
libgdk_linux_fb_include_HEADERS = $(gdk_public_h_sources)
libgdk_linux_fb_1_3_la_SOURCES = $(gdk_c_sources)
libgdk_linux_fb_include_HEADERS = $(gdk_headers)
libgdk_linux_fb_1_3_la_SOURCES = $(gdk_c_sources) gdkenumtypes.c
endif
# now define the real one to workaround automake's mishandling
......@@ -173,7 +178,17 @@ install-exec-local: gdkconfig.h
if test -r $$file && cmp -s gdkconfig.h $$file; then :; \
else $(INSTALL_DATA) gdkconfig.h $$file; fi
BUILT_SOURCES = stamp-gc-h #note: not gdkconfig.h
#note: not gdkconfig.h
BUILT_SOURCES = stamp-gc-h @REBUILD@ gdkenumtypes.c gdkenumtypes.h
gdkenumtypes.h: @REBUILD@ $(gdk_public_h_sources) makeenums.pl
cd $(srcdir) \
&& $(PERL) ./makeenums.pl include $(gdk_public_h_sources) > gdkenumtypes.h
gdkenumtypes.c: @REBUILD@ $(gdk_public_h_sources) makeenums.pl
cd $(srcdir) \
&& $(PERL) ./makeenums.pl cfile $(gdk_public_h_sources) > gdkenumtypes.c
gdkconfig.h: stamp-gc-h
@if test -f gdkconfig.h; then :; \
else rm -f stamp-gc-h; $(MAKE) stamp-gc-h; fi
......
......@@ -333,10 +333,10 @@ gdk_init_check (int *argc,
if (!result)
return FALSE;
gdk_events_init ();
gdk_visual_init ();
_gdk_windowing_window_init ();
_gdk_windowing_image_init ();
gdk_events_init ();
gdk_input_init ();
gdk_dnd_init ();
......
......@@ -31,6 +31,7 @@
#include <gdk/gdkcursor.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkdrawable.h>
#include <gdk/gdkenumtypes.h>
#include <gdk/gdkevents.h>
#include <gdk/gdkfont.h>
#include <gdk/gdkgc.h>
......@@ -114,6 +115,8 @@ gint gdk_screen_height_mm (void) G_GNUC_CONST;
void gdk_flush (void);
void gdk_beep (void);
void gdk_set_double_click_time (guint msec);
/* Rectangle utilities
*/
gboolean gdk_rectangle_intersect (GdkRectangle *src1,
......
......@@ -216,3 +216,35 @@ gdk_color_equal (const GdkColor *colora,
(colora->green == colorb->green) &&
(colora->blue == colorb->blue));
}
GType
gdk_color_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("GdkColor",
NULL,
(GBoxedCopyFunc)gdk_color_copy,
(GBoxedFreeFunc)gdk_color_free,
FALSE);
return our_type;
}
/* We define this here to avoid having to create a new .C file just for this
* function. The rest of GdkVisual is platform-specific
*/
GType
gdk_visual_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("GdkVisual",
NULL,
(GBoxedCopyFunc)gdk_visual_ref,
(GBoxedFreeFunc)gdk_visual_unref,
TRUE);
return our_type;
}
......@@ -34,6 +34,7 @@ typedef struct _GdkColormapClass GdkColormapClass;
#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
#define GDK_TYPE_COLOR (gdk_color_get_type ())
struct _GdkColormap
{
......@@ -96,6 +97,8 @@ guint gdk_color_hash (const GdkColor *colora);
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
GType gdk_color_get_type (void);
/* The following functions are deprecated */
#ifndef GDK_DISABLE_DEPRECATED
void gdk_colors_store (GdkColormap *colormap,
......
......@@ -30,11 +30,6 @@
typedef struct _GdkIOClosure GdkIOClosure;
typedef struct _GdkEventPrivate GdkEventPrivate;
#define DOUBLE_CLICK_TIME 250
#define TRIPLE_CLICK_TIME 500
#define DOUBLE_CLICK_DIST 5
#define TRIPLE_CLICK_DIST 5
typedef enum
{
/* Following flag is set for events on the event queue during
......@@ -84,6 +79,11 @@ GDestroyNotify gdk_event_notify = NULL;
GPollFD event_poll_fd;
static guint double_click_time = 250;
#define TRIPLE_CLICK_TIME (2*double_click_time)
#define DOUBLE_CLICK_DIST 5
#define TRIPLE_CLICK_DIST 5
/*********************************************
* Functions for maintaining the event queue *
*********************************************/
......@@ -326,7 +326,12 @@ gdk_event_copy (GdkEvent *event)
if (event->expose.region)
new_event->expose.region = gdk_region_copy (event->expose.region);
break;
default:
case GDK_SETTING:
new_event->setting.name = g_strdup (new_event->setting.name);
break;
default:
break;
}
......@@ -399,6 +404,10 @@ gdk_event_free (GdkEvent *event)
g_free (event->motion.axes);
break;
case GDK_SETTING:
g_free (event->setting.name);
break;
default:
break;
}
......@@ -464,6 +473,7 @@ gdk_event_get_time (GdkEvent *event)
case GDK_MAP:
case GDK_UNMAP:
case GDK_WINDOW_STATE:
case GDK_SETTING:
/* return current time */
break;
}
......@@ -540,6 +550,7 @@ gdk_event_get_state (GdkEvent *event,
case GDK_MAP:
case GDK_UNMAP:
case GDK_WINDOW_STATE:
case GDK_SETTING:
/* no state field */
break;
}
......@@ -791,7 +802,7 @@ gdk_event_button_generate (GdkEvent *event)
button_number[1] = -1;
button_number[0] = -1;
}
else if ((event->button.time < (button_click_time[0] + DOUBLE_CLICK_TIME)) &&
else if ((event->button.time < (button_click_time[0] + double_click_time)) &&
(event->button.window == button_window[0]) &&
(event->button.button == button_number[0]))
{
......@@ -867,3 +878,22 @@ gdk_synthesize_window_state (GdkWindow *window,
}
}
void
gdk_set_double_click_time (guint msec)
{
double_click_time = msec;
}
GType
gdk_event_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("GdkEvent",
NULL,
(GBoxedCopyFunc)gdk_event_copy,
(GBoxedFreeFunc)gdk_event_free,
FALSE);
return our_type;
}
#ifndef __GDK_EVENTS_H__
#define __GDK_EVENTS_H__
#include <gdk/gdkcolor.h>
#include <gdk/gdktypes.h>
#include <gdk/gdkdnd.h>
#include <gdk/gdkinput.h>
......@@ -9,6 +10,8 @@
extern "C" {
#endif /* __cplusplus */
#define GDK_TYPE_EVENT (gdk_event_get_type ())
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20)
......@@ -30,6 +33,7 @@ typedef struct _GdkEventProximity GdkEventProximity;
typedef struct _GdkEventClient GdkEventClient;
typedef struct _GdkEventDND GdkEventDND;
typedef struct _GdkEventWindowState GdkEventWindowState;
typedef struct _GdkEventSetting GdkEventSetting;
typedef union _GdkEvent GdkEvent;
......@@ -111,7 +115,8 @@ typedef enum
GDK_VISIBILITY_NOTIFY = 29,
GDK_NO_EXPOSE = 30,
GDK_SCROLL = 31,
GDK_WINDOW_STATE = 32
GDK_WINDOW_STATE = 32,
GDK_SETTING = 33
} GdkEventType;
/* Event masks. (Used to select what types of events a window
......@@ -202,6 +207,13 @@ typedef enum
GDK_WINDOW_STATE_STICKY = 1 << 3
} GdkWindowState;
typedef enum
{
GDK_SETTING_ACTION_NEW,
GDK_SETTING_ACTION_CHANGED,
GDK_SETTING_ACTION_DELETED
} GdkSettingAction;
struct _GdkEventAny
{
GdkEventType type;
......@@ -376,6 +388,14 @@ struct _GdkEventClient
} data;
};
struct _GdkEventSetting
{
GdkEventType type;
GdkWindow *window;
gint8 send_event;
GdkSettingAction action;
char *name;
};
struct _GdkEventWindowState
{
......@@ -418,8 +438,11 @@ union _GdkEvent
GdkEventClient client;
GdkEventDND dnd;
GdkEventWindowState window_state;
GdkEventSetting setting;
};
GType gdk_event_get_type (void);
gboolean gdk_events_pending (void);
GdkEvent* gdk_event_get (void);
......@@ -452,6 +475,8 @@ void gdk_add_client_message_filter (GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
gboolean gdk_setting_get (const gchar *name,
GValue *value);
#ifdef __cplusplus
}
......
......@@ -27,6 +27,20 @@
#include "gdkfont.h"
#include "gdkinternals.h"
GType
gdk_font_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("GdkFont",
NULL,
(GBoxedCopyFunc)gdk_font_ref,
(GBoxedFreeFunc)gdk_font_unref,
TRUE);
return our_type;
}
GdkFont*
gdk_font_ref (GdkFont *font)
{
......
......@@ -10,6 +10,8 @@
extern "C" {
#endif /* __cplusplus */
#define GDK_TYPE_FONT gdk_font_get_type
/* Types of font.
* GDK_FONT_FONT: the font is an XFontStruct.
* GDK_FONT_FONTSET: the font is an XFontSet used for I18N.
......@@ -27,6 +29,8 @@ struct _GdkFont
gint descent;
};
GType gdk_font_get_type (void);
GdkFont* gdk_font_load (const gchar *font_name);
GdkFont* gdk_fontset_load (const gchar *fontset_name);
......
......@@ -7,6 +7,8 @@
extern "C" {
#endif /* __cplusplus */
#define GDK_TYPE_VISUAL gdk_visual_get_type
/* Types of visuals.
* StaticGray:
* Grayscale:
......@@ -58,6 +60,8 @@ struct _GdkVisual
gint blue_prec;
};
GType gdk_visual_get_type (void);
gint gdk_visual_get_best_depth (void);
GdkVisualType gdk_visual_get_best_type (void);
GdkVisual* gdk_visual_get_system (void);
......
......@@ -478,8 +478,7 @@ gdk_window_add_filter (GdkWindow *window,
GList *tmp_list;
GdkEventFilter *filter;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
private = (GdkWindowObject*) window;
if (private && GDK_WINDOW_DESTROYED (window))
......@@ -517,8 +516,7 @@ gdk_window_remove_filter (GdkWindow *window,
GList *tmp_list, *node;
GdkEventFilter *filter;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
private = (GdkWindowObject*) window;
......
#!/usr/bin/perl -w
# Information about the current enumeration
my $flags; # Is enumeration a bitmask
my $seenbitshift; # Have we seen bitshift operators?
my $prefix; # Prefix for this enumeration
my $enumname; # Name for this enumeration
my $firstenum = 1; # Is this the first enumeration in file?
my @entries; # [ $name, $val ] for each entry
sub parse_options {
my $opts = shift;
my @opts;
for $opt (split /\s*,\s*/, $opts) {
my ($key,$val) = $opt =~ /\s*(\w+)(?:=(\S+))?/;
defined $val or $val = 1;
push @opts, $key, $val;
}
@opts;
}
sub parse_entries {
my $file = shift;
while (<$file>) {
# Read lines until we have no open comments
while (m@/\*
([^*]|\*(?!/))*$
@x) {
my $new;
defined ($new = <$file>) || die "Unmatched comment";
$_ .= $new;
}
# Now strip comments
s@/\*(?!<)
([^*]+|\*(?!/))*
\*/@@gx;
s@\n@ @;
next if m@^\s*$@;
# Handle include files
if (/^\#include\s*<([^>]*)>/ ) {
my $file= "../$1";
open NEWFILE, $file or die "Cannot open include file $file: $!\n";
if (parse_entries (\*NEWFILE)) {
return 1;
} else {
next;
}
}
if (/^\s*\}\s*(\w+)/) {
$enumname = $1;
return 1;
}
if (m@^\s*
(\w+)\s* # name
(?:=( # value
(?:[^,/]|/(?!\*))*
))?,?\s*
(?:/\*< # options
(([^*]|\*(?!/))*)
>\*/)?
\s*$
@x) {
my ($name, $value, $options) = ($1,$2,$3);
if (!defined $flags && defined $value && $value =~ /<</) {
$seenbitshift = 1;
}
if (defined $options) {
my %options = parse_options($options);
if (!defined $options{skip}) {
push @entries, [ $name, $options{nick} ];
}
} else {
push @entries, [ $name ];
}
} else {
print STDERR "Can't understand: $_\n";
}
}
return 0;
}
my $gen_arrays = 0;
my $gen_defs = 0;
my $gen_includes = 0;
my $gen_cfile = 0;
# Parse arguments
if (@ARGV) {
if ($ARGV[0] eq "arrays") {
shift @ARGV;
$gen_arrays = 1;
} elsif ($ARGV[0] eq "defs") {
shift @ARGV;
$gen_defs = 1;
} elsif ($ARGV[0] eq "include") {
shift @ARGV;
$gen_includes = 1;
} elsif ($ARGV[0] eq "cfile") {
shift @ARGV;
$gen_cfile = 1;
}
}
if ($gen_defs) {
print ";; generated by makeenums.pl ; -*- scheme -*-\n\n";
} else {
print "/* Generated by makeenums.pl */\n\n";
}
if ($gen_includes) {
print "#ifndef __GDK_ENUM_TYPES_H__\n";
print "#define __GDK_ENUM_TYPES_H__\n";
}