Move types to header
This commit is contained in:
parent
7a90df167a
commit
158700c6d7
3 changed files with 64 additions and 58 deletions
2
Makefile
2
Makefile
|
@ -53,7 +53,7 @@ TEST_SRC = \
|
|||
MAIN_SRC = $(MODULES_SRC) src/main.c
|
||||
|
||||
MODULES_HDR = $(MODULES_SRC:.c=.h) $(RUST_APIS)
|
||||
DWM_HDR = $(DWM_SRC:.c=.h)
|
||||
DWM_HDR = $(DWM_SRC:.c=.h) src/dwm/types.h
|
||||
MAIN_HDR = $(MODULES_HDR) src/main.h
|
||||
|
||||
MODULES_OBJ = $(MODULES_SRC:.c=.o)
|
||||
|
|
58
src/dwm.c
58
src/dwm.c
|
@ -81,63 +81,7 @@
|
|||
* types *
|
||||
*********/
|
||||
|
||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||
enum { ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
|
||||
|
||||
typedef struct Monitor Monitor;
|
||||
typedef struct Client Client;
|
||||
|
||||
typedef union {
|
||||
int i;
|
||||
unsigned int ui;
|
||||
float f;
|
||||
const void *v;
|
||||
} Arg;
|
||||
|
||||
typedef struct {
|
||||
unsigned int click;
|
||||
unsigned int mask;
|
||||
unsigned int button;
|
||||
void (*func)(const Arg *arg);
|
||||
const Arg arg;
|
||||
} Button;
|
||||
|
||||
struct Client {
|
||||
struct ClientState state;
|
||||
struct ClientSizeHints size_hints;
|
||||
|
||||
Client *next;
|
||||
Client *snext;
|
||||
Monitor *mon;
|
||||
Window x_window;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned int mod;
|
||||
KeySym keysym;
|
||||
void (*func)(const Arg *);
|
||||
const Arg arg;
|
||||
} Key;
|
||||
|
||||
typedef struct {
|
||||
void (*arrange)(Monitor *);
|
||||
} Layout;
|
||||
|
||||
struct Monitor {
|
||||
struct BasicGeom screen_geom;
|
||||
struct BasicGeom window_area_geom;
|
||||
Unit unit;
|
||||
|
||||
int nmaster;
|
||||
int num;
|
||||
unsigned int sellt;
|
||||
Client *clients;
|
||||
Client *sel;
|
||||
Client *stack;
|
||||
Monitor *next;
|
||||
const Layout *lt[2];
|
||||
};
|
||||
#include "dwm/types.h"
|
||||
|
||||
/*************************
|
||||
* function declarations *
|
||||
|
|
62
src/dwm/types.h
Normal file
62
src/dwm/types.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
#ifndef _DWM_TYPES_H
|
||||
#define _DWM_TYPES_H
|
||||
|
||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||
enum { ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
|
||||
|
||||
typedef struct Monitor Monitor;
|
||||
typedef struct Client Client;
|
||||
|
||||
typedef union {
|
||||
int i;
|
||||
unsigned int ui;
|
||||
float f;
|
||||
const void *v;
|
||||
} Arg;
|
||||
|
||||
typedef struct {
|
||||
unsigned int click;
|
||||
unsigned int mask;
|
||||
unsigned int button;
|
||||
void (*func)(const Arg *arg);
|
||||
const Arg arg;
|
||||
} Button;
|
||||
|
||||
struct Client {
|
||||
struct ClientState state;
|
||||
struct ClientSizeHints size_hints;
|
||||
|
||||
Client *next;
|
||||
Client *snext;
|
||||
Monitor *mon;
|
||||
Window x_window;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned int mod;
|
||||
KeySym keysym;
|
||||
void (*func)(const Arg *);
|
||||
const Arg arg;
|
||||
} Key;
|
||||
|
||||
typedef struct {
|
||||
void (*arrange)(Monitor *);
|
||||
} Layout;
|
||||
|
||||
struct Monitor {
|
||||
struct BasicGeom screen_geom;
|
||||
struct BasicGeom window_area_geom;
|
||||
Unit unit;
|
||||
|
||||
int nmaster;
|
||||
int num;
|
||||
unsigned int sellt;
|
||||
Client *clients;
|
||||
Client *sel;
|
||||
Client *stack;
|
||||
Monitor *next;
|
||||
const Layout *lt[2];
|
||||
};
|
||||
|
||||
#endif // _DWM_TYPES_H
|
Loading…
Reference in a new issue