Move winprop_t to win.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-09 20:24:52 +00:00
parent 733d5dcf54
commit 8805cfa986
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
2 changed files with 23 additions and 28 deletions

View File

@ -231,20 +231,6 @@ typedef struct {
bool invert_color : 1;
} win_upd_t;
/// Structure representing Window property value.
typedef struct winprop {
union {
void *ptr;
char *p8;
short *p16;
long *p32;
unsigned long *c32; // 32bit cardinal
};
unsigned long nitems;
Atom type;
int format;
} winprop_t;
typedef struct _ignore {
struct _ignore *next;
unsigned long sequence;
@ -1584,19 +1570,6 @@ wid_has_prop(const session_t *ps, Window w, Atom atom) {
return false;
}
winprop_t
wid_get_prop_adv(const session_t *ps, Window w, Atom atom, long offset,
long length, Atom rtype, int rformat);
/**
* Wrapper of wid_get_prop_adv().
*/
static inline winprop_t
wid_get_prop(const session_t *ps, Window wid, Atom atom, long length,
Atom rtype, int rformat) {
return wid_get_prop_adv(ps, wid, atom, 0L, length, rtype, rformat);
}
/**
* Get the numeric property value from a win_prop_t.
*/

24
src/x.h
View File

@ -10,7 +10,20 @@
#include "region.h"
typedef struct session session_t;
typedef struct winprop winprop_t;
/// Structure representing Window property value.
typedef struct winprop {
union {
void *ptr;
char *p8;
short *p16;
long *p32;
unsigned long *c32; // 32bit cardinal
};
unsigned long nitems;
xcb_atom_t type;
int format;
} winprop_t;
#define XCB_SYNCED_VOID(func, c, ...) xcb_request_check(c, func##_checked(c, __VA_ARGS__));
#define XCB_SYNCED(func, c, ...) ({ \
@ -54,6 +67,15 @@ winprop_t
wid_get_prop_adv(const session_t *ps, Window w, Atom atom, long offset,
long length, Atom rtype, int rformat);
/**
* Wrapper of wid_get_prop_adv().
*/
static inline winprop_t
wid_get_prop(const session_t *ps, Window wid, Atom atom, long length,
Atom rtype, int rformat) {
return wid_get_prop_adv(ps, wid, atom, 0L, length, rtype, rformat);
}
/**
* Get the value of a type-<code>Window</code> property of a window.
*