Move types to header

This commit is contained in:
Alex Kotov 2022-09-10 00:47:55 +04:00
parent 7a90df167a
commit 158700c6d7
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 64 additions and 58 deletions

View file

@ -53,7 +53,7 @@ TEST_SRC = \
MAIN_SRC = $(MODULES_SRC) src/main.c MAIN_SRC = $(MODULES_SRC) src/main.c
MODULES_HDR = $(MODULES_SRC:.c=.h) $(RUST_APIS) 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 MAIN_HDR = $(MODULES_HDR) src/main.h
MODULES_OBJ = $(MODULES_SRC:.c=.o) MODULES_OBJ = $(MODULES_SRC:.c=.o)

View file

@ -81,63 +81,7 @@
* types * * types *
*********/ *********/
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ #include "dwm/types.h"
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];
};
/************************* /*************************
* function declarations * * function declarations *

62
src/dwm/types.h Normal file
View 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