From ec9fd6bc0e7558c58e27692147f185bf5a596e2b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 24 Feb 2017 19:36:08 -0800 Subject: vwm: split out helper macros into util.h In preparation for separating out the monitoring overlay code from being vwm-coupled, moving these into an independent header since they'll be used throughout. --- src/vwm.h | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/vwm.h') diff --git a/src/vwm.h b/src/vwm.h index 6442faa..fb7ed65 100644 --- a/src/vwm.h +++ b/src/vwm.h @@ -1,15 +1,14 @@ -#ifndef _UTIL_H -#define _UTIL_H +#ifndef _VWM_H +#define _VWM_H -#include // #include // #include -#include #include #include #include "context.h" #include "list.h" +#include "util.h" #define WINDOW_BORDER_WIDTH 1 #define WM_GRAB_MODIFIER Mod1Mask /* the modifier for invoking vwm's controls */ @@ -23,24 +22,6 @@ #define CONSOLE_SESSION_STRING "_vwm_console.$DISPLAY" /* the unique console screen session identifier */ -#define VWM_ERROR(_fmt, _args...) fprintf(stderr, "%s:%i\t%s() "_fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##_args) -#define VWM_PERROR(_fmt, _args...) fprintf(stderr, "%s:%i\t%s() "_fmt"; %s\n", __FILE__, __LINE__, __FUNCTION__, ##_args, strerror(errno)) -#define VWM_BUG(_fmt, _args...) fprintf(stderr, "BUG %s:%i\t%s() "_fmt"; %s\n", __FILE__, __LINE__, __FUNCTION__, ##_args, strerror(errno)) - -#ifdef TRACE -#define VWM_TRACE(_fmt, _args...) fprintf(stderr, "%s:%i\t%s() "_fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##_args) -#else -#define VWM_TRACE(_fmt, _args...) do { } while(0) -#endif - -#define VWM_XROOT(_vwm) RootWindow((_vwm)->display, (_vwm)->screen_num) -#define VWM_XVISUAL(_vwm) DefaultVisual((_vwm)->display, (_vwm)->screen_num) -#define VWM_XDEPTH(_vwm) DefaultDepth((_vwm)->display, (_vwm)->screen_num) - -#define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b)) -#define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b)) -#define NELEMS(_a) (sizeof(_a) / sizeof(_a[0])) - typedef struct _vwm_window_t vwm_window_t; typedef struct _vwm_desktop_t vwm_desktop_t; -- cgit v1.2.3