prefix Group to ObGroup
This commit is contained in:
parent
e4be1f860b
commit
5be23ec5a4
3 changed files with 14 additions and 11 deletions
|
@ -11,7 +11,7 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
struct Frame;
|
struct Frame;
|
||||||
struct Group;
|
struct _ObGroup;
|
||||||
|
|
||||||
typedef struct _ObClient ObClient;
|
typedef struct _ObClient ObClient;
|
||||||
typedef struct _ObClientIcon ObClientIcon;
|
typedef struct _ObClientIcon ObClientIcon;
|
||||||
|
@ -81,14 +81,14 @@ struct _ObClient
|
||||||
int ignore_unmaps;
|
int ignore_unmaps;
|
||||||
|
|
||||||
/*! The id of the group the window belongs to */
|
/*! The id of the group the window belongs to */
|
||||||
struct Group *group;
|
struct _ObGroup *group;
|
||||||
/*! Whether or not the client is a transient window. This is guaranteed to
|
/*! Whether or not the client is a transient window. This is guaranteed to
|
||||||
be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
|
be TRUE if transient_for != NULL, but not guaranteed to be FALSE if
|
||||||
transient_for == NULL. */
|
transient_for == NULL. */
|
||||||
gboolean transient;
|
gboolean transient;
|
||||||
/*! The client which this client is a transient (child) for.
|
/*! The client which this client is a transient (child) for.
|
||||||
A value of TRAN_GROUP signifies that the window is a transient for all
|
A value of TRAN_GROUP signifies that the window is a transient for all
|
||||||
members of its Group, and is not a valid pointer to be followed in this
|
members of its ObGroup, and is not a valid pointer to be followed in this
|
||||||
case.
|
case.
|
||||||
*/
|
*/
|
||||||
ObClient *transient_for;
|
ObClient *transient_for;
|
||||||
|
|
|
@ -17,13 +17,13 @@ void group_shutdown()
|
||||||
g_hash_table_destroy(group_map);
|
g_hash_table_destroy(group_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
Group *group_add(Window leader, ObClient *client)
|
ObGroup *group_add(Window leader, ObClient *client)
|
||||||
{
|
{
|
||||||
Group *self;
|
ObGroup *self;
|
||||||
|
|
||||||
self = g_hash_table_lookup(group_map, &leader);
|
self = g_hash_table_lookup(group_map, &leader);
|
||||||
if (self == NULL) {
|
if (self == NULL) {
|
||||||
self = g_new(Group, 1);
|
self = g_new(ObGroup, 1);
|
||||||
self->leader = leader;
|
self->leader = leader;
|
||||||
self->members = NULL;
|
self->members = NULL;
|
||||||
g_hash_table_insert(group_map, &self->leader, self);
|
g_hash_table_insert(group_map, &self->leader, self);
|
||||||
|
@ -34,7 +34,7 @@ Group *group_add(Window leader, ObClient *client)
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
void group_remove(Group *self, ObClient *client)
|
void group_remove(ObGroup *self, ObClient *client)
|
||||||
{
|
{
|
||||||
self->members = g_slist_remove(self->members, client);
|
self->members = g_slist_remove(self->members, client);
|
||||||
if (self->members == NULL) {
|
if (self->members == NULL) {
|
||||||
|
|
|
@ -4,22 +4,25 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
typedef struct _ObGroup ObGroup;
|
||||||
|
|
||||||
struct _ObClient;
|
struct _ObClient;
|
||||||
|
|
||||||
typedef struct Group {
|
struct _ObGroup
|
||||||
|
{
|
||||||
Window leader;
|
Window leader;
|
||||||
|
|
||||||
/* list of clients */
|
/* list of clients */
|
||||||
GSList *members;
|
GSList *members;
|
||||||
} Group;
|
};
|
||||||
|
|
||||||
extern GHashTable *group_map;
|
extern GHashTable *group_map;
|
||||||
|
|
||||||
void group_startup();
|
void group_startup();
|
||||||
void group_shutdown();
|
void group_shutdown();
|
||||||
|
|
||||||
Group *group_add(Window leader, struct _ObClient *client);
|
ObGroup *group_add(Window leader, struct _ObClient *client);
|
||||||
|
|
||||||
void group_remove(Group *self, struct _ObClient *client);
|
void group_remove(ObGroup *self, struct _ObClient *client);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue