Compare commits

...

3 Commits

Author SHA1 Message Date
Alex Kotov 7861f0ccd6
Move types to other header 2022-09-10 00:51:13 +04:00
Alex Kotov 158700c6d7
Move types to header 2022-09-10 00:47:55 +04:00
Alex Kotov 7a90df167a
Rename files 2022-09-10 00:44:59 +04:00
15 changed files with 81 additions and 75 deletions

View File

@ -38,11 +38,11 @@ MODULES_SRC = \
src/xbase.c
DWM_SRC = \
src/dwm/bar.c \
src/dwm/handlers.c \
src/dwm/layouts.c \
src/dwm/wmcheckwin.c \
src/dwm/xerror.c
src/dwm/spaghetti/bar.c \
src/dwm/spaghetti/handlers.c \
src/dwm/spaghetti/layouts.c \
src/dwm/spaghetti/wmcheckwin.c \
src/dwm/spaghetti/xerror.c
TEST_SRC = \
tests/geom_basic_geom.c \
@ -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)

View File

@ -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 *
@ -195,12 +139,12 @@ static Monitor *wintomon(Window w);
extern const Layout layouts[];
#include "dwm/bar.h"
#include "dwm/handlers.h"
#include "dwm/interaction.h"
#include "dwm/layouts.h"
#include "dwm/wmcheckwin.h"
#include "dwm/xerror.h"
#include "dwm/spaghetti/bar.h"
#include "dwm/spaghetti/handlers.h"
#include "dwm/spaghetti/interaction.h"
#include "dwm/spaghetti/layouts.h"
#include "dwm/spaghetti/wmcheckwin.h"
#include "dwm/spaghetti/xerror.h"
/*************
* variables *
@ -260,12 +204,12 @@ const Layout layouts[] = {
* Private function implementations *
************************************/
#include "dwm/bar.c"
#include "dwm/handlers.c"
#include "dwm/interaction.c"
#include "dwm/layouts.c"
#include "dwm/wmcheckwin.c"
#include "dwm/xerror.c"
#include "dwm/spaghetti/bar.c"
#include "dwm/spaghetti/handlers.c"
#include "dwm/spaghetti/interaction.c"
#include "dwm/spaghetti/layouts.c"
#include "dwm/spaghetti/wmcheckwin.c"
#include "dwm/spaghetti/xerror.c"
/***********************************
* Public function implementations *

View File

@ -1,6 +1,28 @@
#ifndef _DWM_INTERACTION_H
#define _DWM_INTERACTION_H
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;
typedef struct {
unsigned int mod;
KeySym keysym;
void (*func)(const Arg *);
const Arg arg;
} Key;
static void configborder(const Arg *arg);
static void configgap(const Arg *arg);
static void dorestart(const Arg *arg);

40
src/dwm/types.h Normal file
View File

@ -0,0 +1,40 @@
#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;
struct Client {
struct ClientState state;
struct ClientSizeHints size_hints;
Client *next;
Client *snext;
Monitor *mon;
Window x_window;
};
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