Add DMXRequest type.

This commit is contained in:
David Reveman 2008-10-08 12:32:23 -04:00
parent 9106ea0d2b
commit b72d8f4037
3 changed files with 41 additions and 2 deletions

View file

@ -98,6 +98,15 @@ typedef struct _DMXQueue {
DMXSequence **tail;
} DMXQueue;
typedef void (*ReplyProcPtr) (ScreenPtr pScreen,
unsigned int sequence,
xcb_generic_reply_t *reply);
typedef struct _DMXRequest {
DMXSequence base;
ReplyProcPtr reply;
} DMXRequest;
typedef struct _DMXPropTrans {
const char *name;
const char *format;

View file

@ -291,6 +291,9 @@ dmxScreenEventCheckSelection (ScreenPtr pScreen,
xcb_destroy_notify_event_t *xdestroy =
(xcb_destroy_notify_event_t *) event;
if (dmxSelectionDestroyNotify (pScreen, xdestroy->window))
return TRUE;
if (xdestroy->window != dmxScreen->selectionOwner)
return FALSE;
@ -853,7 +856,8 @@ dmxBEDispatch (ScreenPtr pScreen)
xcb_generic_error_t *error;
void *reply;
dmxScreen->inDispatch++;
assert (dmxScreen->inDispatch == FALSE);
dmxScreen->inDispatch = TRUE;
while ((event = xcb_poll_for_event (dmxScreen->connection)))
{
@ -959,7 +963,7 @@ dmxBEDispatch (ScreenPtr pScreen)
dmxScreen->broken = TRUE;
}
dmxScreen->inDispatch--;
dmxScreen->inDispatch = FALSE;
}
static void
@ -1509,3 +1513,25 @@ dmxClearQueue (DMXQueue *q)
q->tail = &q->head;
}
Bool
dmxAddRequest (DMXQueue *q,
ReplyProcPtr reply,
unsigned long sequence)
{
DMXRequest *r;
r = malloc (sizeof (DMXRequest));
if (!r)
return FALSE;
r->base.sequence = sequence;
r->base.next = 0;
r->reply = reply;
*(q->tail) = &r->base;
q->tail = &r->base.next;
return TRUE;
}

View file

@ -52,4 +52,8 @@ extern void dmxBEDispatch (ScreenPtr pScreen);
extern Bool dmxAddSequence (DMXQueue *q, unsigned long sequence);
extern void dmxClearQueue (DMXQueue *q);
extern Bool dmxAddRequest (DMXQueue *q,
ReplyProcPtr reply,
unsigned long sequence);
#endif /* DMXSCRINIT_H */