static Wait_func wait_func;
static void* wait_data;
static Translate_func translate_func = NULL;
+static Expose_func expose_func = NULL;
void
XMenuActivateSetWaitFunction (Wait_func func, void *data)
translate_func = func;
}
+void
+XMenuActivateSetExposeFunction (Expose_func func)
+{
+ expose_func = func;
+}
+
int
XMenuActivate(
register Display *display, /* Display to put menu on. */
feq = feq_tmp;
}
else if (_XMEventHandler) (*_XMEventHandler)(&event);
+
+ if (expose_func)
+ expose_func (&event);
break;
}
if (event_xmp->activated) {
XPutBackEvent on an equivalent artificial core event on any
function it wants to translate. */
typedef void (*Translate_func)(XEvent *);
+typedef void (*Expose_func)(XEvent *);
/*
* XMenu library routine declarations.
void XMenuSetFreeze(XMenu *menu, int freeze);
void XMenuActivateSetWaitFunction(Wait_func func, void *data);
void XMenuActivateSetTranslateFunction(Translate_func func);
+void XMenuActivateSetExposeFunction(Expose_func func);
int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char const *, int, int));
char *XMenuPost(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, int event_mask);
int XMenuDeletePane(Display *display, XMenu *menu, int p_num);
}
}
#endif
+
+#if !defined USE_X_TOOLKIT && !defined USE_GTK
+static void
+x_menu_expose_event (XEvent *event)
+{
+ x_dispatch_event (event, event->xexpose.display);
+}
+#endif
#endif /* ! MSDOS */
\f
#ifdef HAVE_XINPUT2
XMenuActivateSetTranslateFunction (x_menu_translate_generic_event);
#endif
+ XMenuActivateSetExposeFunction (x_menu_expose_event);
#endif
record_unwind_protect_ptr (pop_down_menu,
return count;
}
-#if defined USE_X_TOOLKIT || defined USE_MOTIF || defined USE_GTK
-
/* Handles the XEvent EVENT on display DISPLAY.
This is used for event loops outside the normal event handling,
i.e. looping while a popup menu or a dialog is posted.
Returns the value handle_one_xevent sets in the finish argument. */
+
+#ifdef USE_GTK
+static int
+#else
int
+#endif
x_dispatch_event (XEvent *event, Display *display)
{
struct x_display_info *dpyinfo;
return finish;
}
-#endif
/* Read events coming from the X server.
Return as soon as there are no more events to be read.
extern void x_mouse_leave (struct x_display_info *);
#endif
-#if defined USE_X_TOOLKIT || defined USE_MOTIF
+#ifndef USE_GTK
extern int x_dispatch_event (XEvent *, Display *);
#endif
extern int x_x_to_emacs_modifiers (struct x_display_info *, int);