mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
structs: move some define out
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
569ea75409
commit
d3ceff0282
5 changed files with 53 additions and 52 deletions
14
client.c
14
client.c
|
@ -273,6 +273,20 @@ client_stack_below(client_t *c, xcb_window_t previous)
|
|||
return c->win;
|
||||
}
|
||||
|
||||
/** Stacking layout layers */
|
||||
typedef enum
|
||||
{
|
||||
LAYER_DESKTOP = 1,
|
||||
LAYER_BELOW,
|
||||
LAYER_TILE,
|
||||
LAYER_FLOAT,
|
||||
LAYER_ABOVE,
|
||||
LAYER_FULLSCREEN,
|
||||
LAYER_MODAL,
|
||||
LAYER_ONTOP,
|
||||
LAYER_OUTOFSPACE
|
||||
} layer_t;
|
||||
|
||||
/** Get the real layer of a client according to its attribute (fullscreen, …)
|
||||
* \param c The client.
|
||||
* \return The real layer.
|
||||
|
|
12
client.h
12
client.h
|
@ -27,6 +27,18 @@
|
|||
#include "structs.h"
|
||||
#include "stack.h"
|
||||
|
||||
static void
|
||||
client_delete(client_t **c)
|
||||
{
|
||||
button_array_wipe(&(*c)->buttons);
|
||||
p_delete(&(*c)->icon_path);
|
||||
p_delete(&(*c)->name);
|
||||
p_delete(c);
|
||||
}
|
||||
|
||||
ARRAY_FUNCS(client_t *, client, DO_NOTHING)
|
||||
DO_RCNT(client_t, client, client_delete)
|
||||
|
||||
#define client_need_arrange(c) \
|
||||
do { \
|
||||
if(!globalconf.screens[(c)->screen].need_arrange \
|
||||
|
|
55
structs.h
55
structs.h
|
@ -35,20 +35,6 @@
|
|||
#include "common/xembed.h"
|
||||
#include "common/refcount.h"
|
||||
|
||||
/** Stacking layout layers */
|
||||
typedef enum
|
||||
{
|
||||
LAYER_DESKTOP = 1,
|
||||
LAYER_BELOW,
|
||||
LAYER_TILE,
|
||||
LAYER_FLOAT,
|
||||
LAYER_ABOVE,
|
||||
LAYER_FULLSCREEN,
|
||||
LAYER_MODAL,
|
||||
LAYER_ONTOP,
|
||||
LAYER_OUTOFSPACE
|
||||
} layer_t;
|
||||
|
||||
/** Windows type */
|
||||
typedef enum
|
||||
{
|
||||
|
@ -78,7 +64,7 @@ typedef struct widget_t widget_t;
|
|||
typedef struct widget_node_t widget_node_t;
|
||||
typedef struct client_t client_t;
|
||||
typedef struct client_node_t client_node_t;
|
||||
typedef struct _tag_t tag_t;
|
||||
typedef struct tag tag_t;
|
||||
typedef struct tag_client_node_t tag_client_node_t;
|
||||
typedef widget_t *(widget_constructor_t)(alignment_t);
|
||||
typedef void (widget_destructor_t)(widget_t *);
|
||||
|
@ -129,7 +115,6 @@ struct button_t
|
|||
/** Lua function to execute on release. */
|
||||
luaA_ref release;
|
||||
};
|
||||
|
||||
DO_RCNT(button_t, button, p_delete)
|
||||
DO_ARRAY(button_t *, button, button_unref)
|
||||
|
||||
|
@ -166,29 +151,6 @@ struct widget_t
|
|||
bool isvisible;
|
||||
};
|
||||
|
||||
/** Delete a widget structure.
|
||||
* \param widget The widget to destroy.
|
||||
*/
|
||||
static inline void
|
||||
widget_delete(widget_t **widget)
|
||||
{
|
||||
if((*widget)->destructor)
|
||||
(*widget)->destructor(*widget);
|
||||
button_array_wipe(&(*widget)->buttons);
|
||||
p_delete(&(*widget)->name);
|
||||
p_delete(widget);
|
||||
}
|
||||
|
||||
DO_RCNT(widget_t, widget, widget_delete)
|
||||
|
||||
struct widget_node_t
|
||||
{
|
||||
/** The widget */
|
||||
widget_t *widget;
|
||||
/** The area where the widget was drawn */
|
||||
area_t area;
|
||||
};
|
||||
|
||||
/* Strut */
|
||||
typedef struct
|
||||
{
|
||||
|
@ -273,18 +235,7 @@ struct client_t
|
|||
/** Next and previous clients */
|
||||
client_t *prev, *next;
|
||||
};
|
||||
|
||||
static void
|
||||
client_delete(client_t **c)
|
||||
{
|
||||
button_array_wipe(&(*c)->buttons);
|
||||
p_delete(&(*c)->icon_path);
|
||||
p_delete(&(*c)->name);
|
||||
p_delete(c);
|
||||
}
|
||||
|
||||
DO_ARRAY(client_t *, client, DO_NOTHING)
|
||||
DO_RCNT(client_t, client, client_delete)
|
||||
ARRAY_TYPE(client_t *, client)
|
||||
|
||||
struct client_node_t
|
||||
{
|
||||
|
@ -295,7 +246,7 @@ struct client_node_t
|
|||
};
|
||||
|
||||
/** Tag type */
|
||||
struct _tag_t
|
||||
struct tag
|
||||
{
|
||||
/** Ref count */
|
||||
int refcount;
|
||||
|
|
1
tag.h
1
tag.h
|
@ -23,6 +23,7 @@
|
|||
#define AWESOME_TAG_H
|
||||
|
||||
#include "structs.h"
|
||||
#include "client.h"
|
||||
#include "common/refcount.h"
|
||||
|
||||
/** Check if a client is tiled */
|
||||
|
|
23
widget.h
23
widget.h
|
@ -26,6 +26,29 @@
|
|||
|
||||
#define WIDGET_CACHE_EMBEDDED (1<<3)
|
||||
|
||||
struct widget_node_t
|
||||
{
|
||||
/** The widget */
|
||||
widget_t *widget;
|
||||
/** The area where the widget was drawn */
|
||||
area_t area;
|
||||
};
|
||||
|
||||
/** Delete a widget structure.
|
||||
* \param widget The widget to destroy.
|
||||
*/
|
||||
static inline void
|
||||
widget_delete(widget_t **widget)
|
||||
{
|
||||
if((*widget)->destructor)
|
||||
(*widget)->destructor(*widget);
|
||||
button_array_wipe(&(*widget)->buttons);
|
||||
p_delete(&(*widget)->name);
|
||||
p_delete(widget);
|
||||
}
|
||||
|
||||
DO_RCNT(widget_t, widget, widget_delete)
|
||||
|
||||
void widget_invalidate_cache(int, int);
|
||||
int widget_calculate_offset(int, int, int, int);
|
||||
void widget_common_new(widget_t *);
|
||||
|
|
Loading…
Reference in a new issue