dix: Refactoring of selection code to allow for polyinstantiation.

Introduces dixLookupSelection() API.
Removes NumCurrentSelections from API.
This commit is contained in:
Eamon Walsh 2008-02-29 18:00:23 -05:00 • committed by Eamon Walsh
commit 34bf308a9e
8 changed files with 352 additions and 311 deletions

View file

@ -1,7 +1,3 @@
#ifndef SELECTION_H
#define SELECTION_H 1
/***********************************************************
Copyright 1987, 1998 The Open Group
@ -49,10 +45,13 @@ SOFTWARE.
******************************************************************/
#ifndef SELECTION_H
#define SELECTION_H 1
#include "dixstruct.h"
#include "privates.h"
/*
*
* Selection data structures
*/
@ -62,11 +61,45 @@ typedef struct _Selection {
Window window;
WindowPtr pWin;
ClientPtr client;
ClientPtr alt_client; /* support for redirection */
Window alt_window; /* support for redirection */
struct _Selection *next;
PrivateRec *devPrivates;
} Selection;
/*
* Selection API
*/
int dixLookupSelection(Selection **result, Atom name,
ClientPtr client, Mask access_mode);
extern Selection *CurrentSelections;
extern CallbackListPtr SelectionCallback;
typedef enum {
SelectionSetOwner,
SelectionWindowDestroy,
SelectionClientClose
} SelectionCallbackKind;
typedef struct {
struct _Selection *selection;
ClientPtr client;
SelectionCallbackKind kind;
} SelectionInfoRec;
/*
* Selection server internals
*/
void InitSelections(void);
void DeleteWindowFromAnySelections(WindowPtr pWin);
void DeleteClientFromAnySelections(ClientPtr client);
#endif /* SELECTION_H */