Added new GDK_NO_EXPOSE and GDK_VISIBILITY_NOTIFY events. They are needed
for the TV widget by Alan Cox and by the GtkXmHTML widget. Only missing with respect to their Xlib counterparts are the major_code and minor_code fields in the GdkEventNoExpose structure. Does anyone need them for their code? - Federico
This commit is contained in:
25
gdk/gdk.c
25
gdk/gdk.c
@ -2285,7 +2285,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
g_print ("no expose:\t\tdrawable: %ld\n",
|
||||
xevent->xnoexpose.drawable - base_id);
|
||||
|
||||
/* Not currently handled */
|
||||
event->no_expose.type = GDK_NO_EXPOSE;
|
||||
event->no_expose.window = window;
|
||||
|
||||
return_val = window_private && !window_private->destroyed;
|
||||
break;
|
||||
|
||||
case VisibilityNotify:
|
||||
@ -2308,7 +2311,25 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
}
|
||||
|
||||
/* Not currently handled */
|
||||
event->visibility.type = GDK_VISIBILITY_NOTIFY;
|
||||
event->visibility.window = window;
|
||||
|
||||
switch (xevent->xvisibility.state)
|
||||
{
|
||||
case VisibilityFullyObscured:
|
||||
event->visibility.state = GDK_VISIBILITY_FULLY_OBSCURED;
|
||||
break;
|
||||
|
||||
case VisibilityPartiallyObscured:
|
||||
event->visibility.state = GDK_VISIBILITY_PARTIAL;
|
||||
break;
|
||||
|
||||
case VisibilityUnobscured:
|
||||
event->visibility.state = GDK_VISIBILITY_UNOBSCURED;
|
||||
break;
|
||||
}
|
||||
|
||||
return_val = window_private && !window_private->destroyed;
|
||||
break;
|
||||
|
||||
case CreateNotify:
|
||||
|
||||
@ -62,6 +62,8 @@ typedef struct _GdkColorContext GdkColorContext;
|
||||
|
||||
typedef struct _GdkEventAny GdkEventAny;
|
||||
typedef struct _GdkEventExpose GdkEventExpose;
|
||||
typedef struct _GdkEventNoExpose GdkEventNoExpose;
|
||||
typedef struct _GdkEventVisibility GdkEventVisibility;
|
||||
typedef struct _GdkEventMotion GdkEventMotion;
|
||||
typedef struct _GdkEventButton GdkEventButton;
|
||||
typedef struct _GdkEventKey GdkEventKey;
|
||||
@ -286,12 +288,20 @@ typedef enum {
|
||||
GDK_FILTER_REMOVE /* Terminate processing, removing event */
|
||||
} GdkFilterReturn;
|
||||
|
||||
typedef enum {
|
||||
GDK_VISIBILITY_UNOBSCURED,
|
||||
GDK_VISIBILITY_PARTIAL,
|
||||
GDK_VISIBILITY_FULLY_OBSCURED
|
||||
} GdkVisibilityState;
|
||||
|
||||
/* Event types.
|
||||
* Nothing: No event occurred.
|
||||
* Delete: A window delete event was sent by the window manager.
|
||||
* The specified window should be deleted.
|
||||
* Destroy: A window has been destroyed.
|
||||
* Expose: Part of a window has been uncovered.
|
||||
* NoExpose: Same as expose, but no expose event was generated.
|
||||
* VisibilityNotify: A window has become fully/partially/not obscured.
|
||||
* MotionNotify: The mouse has moved.
|
||||
* ButtonPress: A mouse button was pressed.
|
||||
* ButtonRelease: A mouse button was release.
|
||||
@ -337,6 +347,8 @@ typedef enum
|
||||
GDK_DROP_LEAVE = 25,
|
||||
GDK_DROP_DATA_AVAIL = 26,
|
||||
GDK_CLIENT_EVENT = 27,
|
||||
GDK_VISIBILITY_NOTIFY = 28,
|
||||
GDK_NO_EXPOSE = 29,
|
||||
GDK_OTHER_EVENT = 9999
|
||||
} GdkEventType;
|
||||
|
||||
@ -363,6 +375,7 @@ typedef enum
|
||||
GDK_PROPERTY_CHANGE_MASK = 1 << 16,
|
||||
GDK_PROXIMITY_IN_MASK = 1 << 17,
|
||||
GDK_PROXIMITY_OUT_MASK = 1 << 18,
|
||||
GDK_VISIBILITY_NOTIFY_MASK = 1 << 19,
|
||||
GDK_ALL_EVENTS_MASK = 0x07FFFF
|
||||
} GdkEventMask;
|
||||
|
||||
@ -860,6 +873,20 @@ struct _GdkEventExpose
|
||||
gint count; /* If non-zero, how many more events follow. */
|
||||
};
|
||||
|
||||
struct _GdkEventNoExpose
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
/* XXX: does anyone need the X major_code or minor_code fields? */
|
||||
};
|
||||
|
||||
struct _GdkEventVisibility
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkWindow *window;
|
||||
GdkVisibilityState state;
|
||||
};
|
||||
|
||||
struct _GdkEventMotion
|
||||
{
|
||||
GdkEventType type;
|
||||
@ -1072,6 +1099,8 @@ union _GdkEvent
|
||||
GdkEventType type;
|
||||
GdkEventAny any;
|
||||
GdkEventExpose expose;
|
||||
GdkEventNoExpose no_expose;
|
||||
GdkEventVisibility visibility;
|
||||
GdkEventMotion motion;
|
||||
GdkEventButton button;
|
||||
GdkEventKey key;
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int nevent_masks = 16;
|
||||
int event_mask_table[18] =
|
||||
int nevent_masks = 17;
|
||||
int event_mask_table[19] =
|
||||
{
|
||||
ExposureMask,
|
||||
PointerMotionMask,
|
||||
@ -47,7 +47,8 @@ int event_mask_table[18] =
|
||||
StructureNotifyMask,
|
||||
PropertyChangeMask,
|
||||
0, /* PROXIMITY_IN */
|
||||
0 /* PROXIMTY_OUT */
|
||||
0, /* PROXIMTY_OUT */
|
||||
VisibilityChangeMask
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2285,7 +2285,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
g_print ("no expose:\t\tdrawable: %ld\n",
|
||||
xevent->xnoexpose.drawable - base_id);
|
||||
|
||||
/* Not currently handled */
|
||||
event->no_expose.type = GDK_NO_EXPOSE;
|
||||
event->no_expose.window = window;
|
||||
|
||||
return_val = window_private && !window_private->destroyed;
|
||||
break;
|
||||
|
||||
case VisibilityNotify:
|
||||
@ -2308,7 +2311,25 @@ gdk_event_translate (GdkEvent *event,
|
||||
break;
|
||||
}
|
||||
|
||||
/* Not currently handled */
|
||||
event->visibility.type = GDK_VISIBILITY_NOTIFY;
|
||||
event->visibility.window = window;
|
||||
|
||||
switch (xevent->xvisibility.state)
|
||||
{
|
||||
case VisibilityFullyObscured:
|
||||
event->visibility.state = GDK_VISIBILITY_FULLY_OBSCURED;
|
||||
break;
|
||||
|
||||
case VisibilityPartiallyObscured:
|
||||
event->visibility.state = GDK_VISIBILITY_PARTIAL;
|
||||
break;
|
||||
|
||||
case VisibilityUnobscured:
|
||||
event->visibility.state = GDK_VISIBILITY_UNOBSCURED;
|
||||
break;
|
||||
}
|
||||
|
||||
return_val = window_private && !window_private->destroyed;
|
||||
break;
|
||||
|
||||
case CreateNotify:
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int nevent_masks = 16;
|
||||
int event_mask_table[18] =
|
||||
int nevent_masks = 17;
|
||||
int event_mask_table[19] =
|
||||
{
|
||||
ExposureMask,
|
||||
PointerMotionMask,
|
||||
@ -47,7 +47,8 @@ int event_mask_table[18] =
|
||||
StructureNotifyMask,
|
||||
PropertyChangeMask,
|
||||
0, /* PROXIMITY_IN */
|
||||
0 /* PROXIMTY_OUT */
|
||||
0, /* PROXIMTY_OUT */
|
||||
VisibilityChangeMask
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user