Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstracted recursive include guards out (caused warnings) #191

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <math.h> /* fabsf() */

#include "client.h"
#include "monitor.h"

#include "desktop.h"

#include "dwm.h"
Expand Down
14 changes: 5 additions & 9 deletions client.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include <stdint.h>

typedef struct Desktop Desktop;

/* kill client type */
enum KillType
{
Expand Down Expand Up @@ -43,7 +41,9 @@ enum ManageCookies

typedef struct Client Client;
typedef struct Decoration Decoration;
typedef struct Monitor Monitor;

/* extern structs */
struct Desktop;

struct Decoration
{
Expand Down Expand Up @@ -111,7 +111,7 @@ struct Client
Client *rprev; /* Restack Prev */
Client *fnext; /* The next focused client */
Client *fprev; /* THe previous focused clnt*/
Desktop *desktop; /* Client Associated Desktop*/
struct Desktop *desktop; /* Client Associated Desktop*/
Decoration *decor; /* Decoration AKA title bar.*/

char *netwmname; /* Client Name */
Expand Down Expand Up @@ -276,15 +276,11 @@ void setborderwidth(Client *c, uint16_t border_width);
/* Sets the clients desktop to the specified desktop,
* and cleanups any data that may have been left from the previous desktop.
*/
void setclientdesktop(Client *c, Desktop *desktop);
void setclientdesktop(Client *c, struct Desktop *desktop);
/* Sets the clients wmatom[WMState] property. */
void setclientstate(Client *c, uint8_t state);
/* Sets the decor visibility. */
void setdecorvisible(Client *c, uint8_t state);
/* Sets the desktop count rolling back any clients to previous desktops. */
void setdesktopcount(Monitor *m, uint16_t desktops);
/* Sets the currently selected desktop */
void setdesktopsel(Monitor *mon, Desktop *desksel);
/* Sets the flag to disable border >>CHANGES<< for a client. */
void setdisableborder(Client *c, uint8_t state);
/* Sets the clients pid. */
Expand Down
7 changes: 5 additions & 2 deletions desktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define _WM_DESKTOP_H

#include "client.h"
#include "settings.h"

/* layout(s) */
enum LayoutType
{
Expand All @@ -10,7 +12,8 @@ enum LayoutType

typedef struct Desktop Desktop;
typedef struct Layout Layout;
typedef struct UserSettings UserSettings;
/* extern structs */
struct Monitor;

struct Desktop
{
Expand All @@ -19,7 +22,7 @@ struct Desktop
uint8_t layout; /* The Layout Index */
uint8_t olayout; /* The Previous Layout Index */

Monitor *mon; /* Desktop Monitor */
struct Monitor *mon; /* Desktop Monitor */
Client *clients; /* First Client in linked list */
Client *clast; /* Last Client in linked list */
Client *stack; /* Client Stack Order */
Expand Down
2 changes: 1 addition & 1 deletion dwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "settings.h"
#include "pannel.h"
#include "client.h"
#include "monitor.h"
#include "desktop.h"
#include "monitor.h"
#include "XCB-TRL/xcb_trl.h"
#include "XCB-TRL/xcb_winutil.h"
#include "XCB-TRL/xcb_gtk.h"
Expand Down
6 changes: 4 additions & 2 deletions monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <stdint.h>
#include "desktop.h"
#include "client.h"

/* cursor */
enum CurType
Expand All @@ -20,7 +19,6 @@ enum ClientListModes
ClientListAdd, ClientListRemove, ClientListReload,
};

/* color schemes */
typedef struct Monitor Monitor;

struct Monitor
Expand Down Expand Up @@ -83,6 +81,10 @@ Monitor *dirtomon(uint8_t dir);
* RETURN: NULL on Failure.
*/
Monitor *nextmonitor(Monitor *monitor);
/* Sets the desktop count rolling back any clients to previous desktops. */
void setdesktopcount(Monitor *m, uint16_t desktops);
/* Sets the currently selected desktop */
void setdesktopsel(Monitor *mon, Desktop *desksel);
/* Sets up the cursors used for the WM. */
void setupcursors(void);
/* Updates
Expand Down