rename the Client struct to ObClient

This commit is contained in:
Dana Jansens 2003-07-10 06:38:42 +00:00
parent 375b504905
commit 2477a38d2f
31 changed files with 315 additions and 308 deletions

View file

@ -700,7 +700,7 @@ void action_toggle_omnipresent(union ActionData *data)
void action_move_relative_horz(union ActionData *data) void action_move_relative_horz(union ActionData *data)
{ {
Client *c = data->relative.c; ObClient *c = data->relative.c;
if (c) if (c)
client_configure(c, OB_CORNER_TOPLEFT, client_configure(c, OB_CORNER_TOPLEFT,
c->area.x + data->relative.delta, c->area.y, c->area.x + data->relative.delta, c->area.y,
@ -709,7 +709,7 @@ void action_move_relative_horz(union ActionData *data)
void action_move_relative_vert(union ActionData *data) void action_move_relative_vert(union ActionData *data)
{ {
Client *c = data->relative.c; ObClient *c = data->relative.c;
if (c) if (c)
client_configure(c, OB_CORNER_TOPLEFT, client_configure(c, OB_CORNER_TOPLEFT,
c->area.x, c->area.y + data->relative.delta, c->area.x, c->area.y + data->relative.delta,
@ -718,7 +718,7 @@ void action_move_relative_vert(union ActionData *data)
void action_resize_relative_horz(union ActionData *data) void action_resize_relative_horz(union ActionData *data)
{ {
Client *c = data->relative.c; ObClient *c = data->relative.c;
if (c) if (c)
client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y, client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y,
c->area.width + c->area.width +
@ -728,7 +728,7 @@ void action_resize_relative_horz(union ActionData *data)
void action_resize_relative_vert(union ActionData *data) void action_resize_relative_vert(union ActionData *data)
{ {
Client *c = data->relative.c; ObClient *c = data->relative.c;
if (c && !c->shaded) if (c && !c->shaded)
client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y, client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y,
c->area.width, c->area.height + c->area.width, c->area.height +
@ -1098,7 +1098,7 @@ void action_send_to_desktop_up(union ActionData *data)
void action_toggle_decorations(union ActionData *data) void action_toggle_decorations(union ActionData *data)
{ {
Client *c = data->client.c;; ObClient *c = data->client.c;;
if (!c) return; if (!c) return;
@ -1108,7 +1108,7 @@ void action_toggle_decorations(union ActionData *data)
void action_moveresize(union ActionData *data) void action_moveresize(union ActionData *data)
{ {
Client *c = data->moveresize.c; ObClient *c = data->moveresize.c;
if (!c || !client_normal(c)) return; if (!c || !client_normal(c)) return;
@ -1137,7 +1137,7 @@ void action_showmenu(union ActionData *data)
void action_cycle_windows(union ActionData *data) void action_cycle_windows(union ActionData *data)
{ {
Client *c; ObClient *c;
c = focus_cycle(data->cycle.forward, data->cycle.linear, data->cycle.final, c = focus_cycle(data->cycle.forward, data->cycle.linear, data->cycle.final,
data->cycle.cancel); data->cycle.cancel);
@ -1145,7 +1145,7 @@ void action_cycle_windows(union ActionData *data)
void action_directional_focus(union ActionData *data) void action_directional_focus(union ActionData *data)
{ {
Client *nf; ObClient *nf;
if (!data->diraction.c) if (!data->diraction.c)
return; return;
@ -1157,7 +1157,7 @@ void action_directional_focus(union ActionData *data)
void action_movetoedge(union ActionData *data) void action_movetoedge(union ActionData *data)
{ {
int x, y, h, w; int x, y, h, w;
Client *c = data->diraction.c; ObClient *c = data->diraction.c;
if (!c) if (!c)
return; return;
@ -1196,7 +1196,7 @@ void action_send_to_layer(union ActionData *data)
void action_toggle_layer(union ActionData *data) void action_toggle_layer(union ActionData *data)
{ {
Client *c = data->layer.c; ObClient *c = data->layer.c;
if (c) { if (c) {
if (data->layer.layer < 0) if (data->layer.layer < 0)

View file

@ -10,57 +10,57 @@
*/ */
struct AnyAction { struct AnyAction {
Client *c; ObClient *c;
}; };
struct DirectionalAction{ struct DirectionalAction{
Client *c; ObClient *c;
ObDirection direction; ObDirection direction;
}; };
struct Execute { struct Execute {
Client *c; ObClient *c;
char *path; char *path;
}; };
struct ClientAction { struct ClientAction {
Client *c; ObClient *c;
}; };
struct MoveResizeRelative { struct MoveResizeRelative {
Client *c; ObClient *c;
int delta; int delta;
}; };
struct SendToDesktop { struct SendToDesktop {
Client *c; ObClient *c;
guint desk; guint desk;
gboolean follow; gboolean follow;
}; };
struct SendToDesktopDirection { struct SendToDesktopDirection {
Client *c; ObClient *c;
gboolean wrap; gboolean wrap;
gboolean follow; gboolean follow;
}; };
struct Desktop { struct Desktop {
Client *c; ObClient *c;
guint desk; guint desk;
}; };
struct Layer { struct Layer {
Client *c; ObClient *c;
int layer; /* < 0 = below, 0 = normal, > 0 = above */ int layer; /* < 0 = below, 0 = normal, > 0 = above */
}; };
struct DesktopDirection { struct DesktopDirection {
Client *c; ObClient *c;
gboolean wrap; gboolean wrap;
}; };
struct MoveResize { struct MoveResize {
Client *c; ObClient *c;
int x; int x;
int y; int y;
guint32 corner; /* prop_atoms.net_wm_moveresize_* */ guint32 corner; /* prop_atoms.net_wm_moveresize_* */
@ -68,14 +68,14 @@ struct MoveResize {
}; };
struct ShowMenu { struct ShowMenu {
Client *c; ObClient *c;
char *name; char *name;
int x; int x;
int y; int y;
}; };
struct CycleWindows { struct CycleWindows {
Client *c; ObClient *c;
gboolean linear; gboolean linear;
gboolean forward; gboolean forward;
gboolean final; gboolean final;

View file

@ -30,18 +30,18 @@
GList *client_list = NULL; GList *client_list = NULL;
static void client_get_all(Client *self); static void client_get_all(ObClient *self);
static void client_toggle_border(Client *self, gboolean show); static void client_toggle_border(ObClient *self, gboolean show);
static void client_get_area(Client *self); static void client_get_area(ObClient *self);
static void client_get_desktop(Client *self); static void client_get_desktop(ObClient *self);
static void client_get_state(Client *self); static void client_get_state(ObClient *self);
static void client_get_shaped(Client *self); static void client_get_shaped(ObClient *self);
static void client_get_mwm_hints(Client *self); static void client_get_mwm_hints(ObClient *self);
static void client_get_gravity(Client *self); static void client_get_gravity(ObClient *self);
static void client_showhide(Client *self); static void client_showhide(ObClient *self);
static void client_change_allowed_actions(Client *self); static void client_change_allowed_actions(ObClient *self);
static void client_change_state(Client *self); static void client_change_state(ObClient *self);
static void client_apply_startup_state(Client *self); static void client_apply_startup_state(ObClient *self);
void client_startup() void client_startup()
{ {
@ -63,7 +63,7 @@ void client_set_list()
windows = g_new(Window, size); windows = g_new(Window, size);
win_it = windows; win_it = windows;
for (it = client_list; it != NULL; it = it->next, ++win_it) for (it = client_list; it != NULL; it = it->next, ++win_it)
*win_it = ((Client*)it->data)->window; *win_it = ((ObClient*)it->data)->window;
} else } else
windows = NULL; windows = NULL;
@ -76,7 +76,7 @@ void client_set_list()
} }
/* /*
void client_foreach_transient(Client *self, ClientForeachFunc func, void *data) void client_foreach_transient(ObClient *self, ObClientForeachFunc func, void *data)
{ {
GSList *it; GSList *it;
@ -86,7 +86,7 @@ void client_foreach_transient(Client *self, ClientForeachFunc func, void *data)
} }
} }
void client_foreach_ancestor(Client *self, ClientForeachFunc func, void *data) void client_foreach_ancestor(ObClient *self, ObClientForeachFunc func, void *data)
{ {
if (self->transient_for) { if (self->transient_for) {
if (self->transient_for != TRAN_GROUP) { if (self->transient_for != TRAN_GROUP) {
@ -97,7 +97,7 @@ void client_foreach_ancestor(Client *self, ClientForeachFunc func, void *data)
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (it->data != self && if (it->data != self &&
!((Client*)it->data)->transient_for) { !((ObClient*)it->data)->transient_for) {
if (!func(it->data, data)) return; if (!func(it->data, data)) return;
client_foreach_ancestor(it->data, func, data); client_foreach_ancestor(it->data, func, data);
} }
@ -176,7 +176,7 @@ void client_manage_all()
void client_manage(Window window) void client_manage(Window window)
{ {
Client *self; ObClient *self;
XEvent e; XEvent e;
XWindowAttributes attrib; XWindowAttributes attrib;
XSetWindowAttributes attrib_set; XSetWindowAttributes attrib_set;
@ -223,9 +223,9 @@ void client_manage(Window window)
CWEventMask|CWDontPropagate, &attrib_set); CWEventMask|CWDontPropagate, &attrib_set);
/* create the Client struct, and populate it from the hints on the /* create the ObClient struct, and populate it from the hints on the
window */ window */
self = g_new(Client, 1); self = g_new(ObClient, 1);
self->obwin.type = Window_Client; self->obwin.type = Window_Client;
self->window = window; self->window = window;
client_get_all(self); client_get_all(self);
@ -316,11 +316,11 @@ void client_unmanage_all()
/* called by client_unmanage() to close any menus referencing this client */ /* called by client_unmanage() to close any menus referencing this client */
void client_close_menus(gpointer key, gpointer value, gpointer self) void client_close_menus(gpointer key, gpointer value, gpointer self)
{ {
if (((Menu *)value)->client == (Client *)self) if (((Menu *)value)->client == (ObClient *)self)
menu_hide((Menu *)value); menu_hide((Menu *)value);
} }
void client_unmanage(Client *self) void client_unmanage(ObClient *self)
{ {
int j; int j;
GSList *it; GSList *it;
@ -355,8 +355,8 @@ void client_unmanage(Client *self)
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (it->data != self) if (it->data != self)
((Client*)it->data)->transients = ((ObClient*)it->data)->transients =
g_slist_remove(((Client*)it->data)->transients, self); g_slist_remove(((ObClient*)it->data)->transients, self);
} else if (self->transient_for) { /* transient of window */ } else if (self->transient_for) { /* transient of window */
self->transient_for->transients = self->transient_for->transients =
g_slist_remove(self->transient_for->transients, self); g_slist_remove(self->transient_for->transients, self);
@ -364,8 +364,8 @@ void client_unmanage(Client *self)
/* tell our transients that we're gone */ /* tell our transients that we're gone */
for (it = self->transients; it != NULL; it = it->next) { for (it = self->transients; it != NULL; it = it->next) {
if (((Client*)it->data)->transient_for != TRAN_GROUP) { if (((ObClient*)it->data)->transient_for != TRAN_GROUP) {
((Client*)it->data)->transient_for = NULL; ((ObClient*)it->data)->transient_for = NULL;
client_calc_layer(it->data); client_calc_layer(it->data);
} }
} }
@ -435,7 +435,7 @@ void client_unmanage(Client *self)
client_set_list(); client_set_list();
} }
void client_move_onscreen(Client *self) void client_move_onscreen(ObClient *self)
{ {
Rect *a; Rect *a;
int x = self->frame->area.x, y = self->frame->area.y; int x = self->frame->area.x, y = self->frame->area.y;
@ -458,7 +458,7 @@ void client_move_onscreen(Client *self)
TRUE, TRUE); TRUE, TRUE);
} }
static void client_toggle_border(Client *self, gboolean show) static void client_toggle_border(ObClient *self, gboolean show)
{ {
/* adjust our idea of where the client is, based on its border. When the /* adjust our idea of where the client is, based on its border. When the
border is removed, the client should now be considered to be in a border is removed, the client should now be considered to be in a
@ -524,7 +524,7 @@ static void client_toggle_border(Client *self, gboolean show)
} }
static void client_get_all(Client *self) static void client_get_all(ObClient *self)
{ {
/* update EVERYTHING!! */ /* update EVERYTHING!! */
@ -574,7 +574,7 @@ static void client_get_all(Client *self)
client_change_state(self); client_change_state(self);
} }
static void client_get_area(Client *self) static void client_get_area(ObClient *self)
{ {
XWindowAttributes wattrib; XWindowAttributes wattrib;
Status ret; Status ret;
@ -586,7 +586,7 @@ static void client_get_area(Client *self)
self->border_width = wattrib.border_width; self->border_width = wattrib.border_width;
} }
static void client_get_desktop(Client *self) static void client_get_desktop(ObClient *self)
{ {
guint32 d = screen_num_desktops; /* an always-invalid value */ guint32 d = screen_num_desktops; /* an always-invalid value */
@ -607,8 +607,8 @@ static void client_get_desktop(Client *self)
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (it->data != self && if (it->data != self &&
!((Client*)it->data)->transient_for) { !((ObClient*)it->data)->transient_for) {
self->desktop = ((Client*)it->data)->desktop; self->desktop = ((ObClient*)it->data)->desktop;
trdesk = TRUE; trdesk = TRUE;
break; break;
} }
@ -625,7 +625,7 @@ static void client_get_desktop(Client *self)
} }
} }
static void client_get_state(Client *self) static void client_get_state(ObClient *self)
{ {
guint32 *state; guint32 *state;
guint num; guint num;
@ -663,7 +663,7 @@ static void client_get_state(Client *self)
} }
} }
static void client_get_shaped(Client *self) static void client_get_shaped(ObClient *self)
{ {
self->shaped = FALSE; self->shaped = FALSE;
#ifdef SHAPE #ifdef SHAPE
@ -682,10 +682,10 @@ static void client_get_shaped(Client *self)
#endif #endif
} }
void client_update_transient_for(Client *self) void client_update_transient_for(ObClient *self)
{ {
Window t = None; Window t = None;
Client *c = NULL; ObClient *c = NULL;
if (XGetTransientForHint(ob_display, self->window, &t)) { if (XGetTransientForHint(ob_display, self->window, &t)) {
self->transient = TRUE; self->transient = TRUE;
@ -717,9 +717,9 @@ void client_update_transient_for(Client *self)
/* remove from old parents */ /* remove from old parents */
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (it->data != self && if (it->data != self &&
!((Client*)it->data)->transient_for) !((ObClient*)it->data)->transient_for)
((Client*)it->data)->transients = ((ObClient*)it->data)->transients =
g_slist_remove(((Client*)it->data)->transients, self); g_slist_remove(((ObClient*)it->data)->transients, self);
} else if (self->transient_for != NULL) { /* transient of window */ } else if (self->transient_for != NULL) { /* transient of window */
/* remove from old parent */ /* remove from old parent */
self->transient_for->transients = self->transient_for->transients =
@ -732,9 +732,9 @@ void client_update_transient_for(Client *self)
/* add to new parents */ /* add to new parents */
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (it->data != self && if (it->data != self &&
!((Client*)it->data)->transient_for) !((ObClient*)it->data)->transient_for)
((Client*)it->data)->transients = ((ObClient*)it->data)->transients =
g_slist_append(((Client*)it->data)->transients, self); g_slist_append(((ObClient*)it->data)->transients, self);
/* remove all transients which are in the group, that causes /* remove all transients which are in the group, that causes
circlular pointer hell of doom */ circlular pointer hell of doom */
@ -755,7 +755,7 @@ void client_update_transient_for(Client *self)
} }
} }
static void client_get_mwm_hints(Client *self) static void client_get_mwm_hints(ObClient *self)
{ {
guint num; guint num;
guint32 *hints; guint32 *hints;
@ -773,7 +773,7 @@ static void client_get_mwm_hints(Client *self)
} }
} }
void client_get_type(Client *self) void client_get_type(ObClient *self)
{ {
guint num, i; guint num, i;
guint32 *val; guint32 *val;
@ -824,7 +824,7 @@ void client_get_type(Client *self)
} }
} }
void client_update_protocols(Client *self) void client_update_protocols(ObClient *self)
{ {
guint32 *proto; guint32 *proto;
guint num_return, i; guint num_return, i;
@ -846,7 +846,7 @@ void client_update_protocols(Client *self)
} }
} }
static void client_get_gravity(Client *self) static void client_get_gravity(ObClient *self)
{ {
XWindowAttributes wattrib; XWindowAttributes wattrib;
Status ret; Status ret;
@ -856,7 +856,7 @@ static void client_get_gravity(Client *self)
self->gravity = wattrib.win_gravity; self->gravity = wattrib.win_gravity;
} }
void client_update_normal_hints(Client *self) void client_update_normal_hints(ObClient *self)
{ {
XSizeHints size; XSizeHints size;
long ret; long ret;
@ -909,7 +909,7 @@ void client_update_normal_hints(Client *self)
} }
} }
void client_setup_decor_and_functions(Client *self) void client_setup_decor_and_functions(ObClient *self)
{ {
/* start with everything (cept fullscreen) */ /* start with everything (cept fullscreen) */
self->decorations = Decor_Titlebar | Decor_Handle | Decor_Border | self->decorations = Decor_Titlebar | Decor_Handle | Decor_Border |
@ -1040,7 +1040,7 @@ void client_setup_decor_and_functions(Client *self)
} }
} }
static void client_change_allowed_actions(Client *self) static void client_change_allowed_actions(ObClient *self)
{ {
guint32 actions[9]; guint32 actions[9];
int num = 0; int num = 0;
@ -1090,7 +1090,7 @@ static void client_change_allowed_actions(Client *self)
} }
} }
void client_reconfigure(Client *self) void client_reconfigure(ObClient *self)
{ {
/* by making this pass FALSE for user, we avoid the emacs event storm where /* by making this pass FALSE for user, we avoid the emacs event storm where
every configurenotify causes an update in its normal hints, i think this every configurenotify causes an update in its normal hints, i think this
@ -1099,7 +1099,7 @@ void client_reconfigure(Client *self)
self->area.width, self->area.height, FALSE, TRUE); self->area.width, self->area.height, FALSE, TRUE);
} }
void client_update_wmhints(Client *self) void client_update_wmhints(ObClient *self)
{ {
XWMHints *hints; XWMHints *hints;
gboolean ur = FALSE; gboolean ur = FALSE;
@ -1146,7 +1146,7 @@ void client_update_wmhints(Client *self)
set up */ set up */
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (it->data != self && if (it->data != self &&
((Client*)it->data)->transient_for == TRAN_GROUP) ((ObClient*)it->data)->transient_for == TRAN_GROUP)
self->transients = g_slist_append(self->transients, self->transients = g_slist_append(self->transients,
it->data); it->data);
} }
@ -1176,7 +1176,7 @@ void client_update_wmhints(Client *self)
} }
} }
void client_update_title(Client *self) void client_update_title(ObClient *self)
{ {
GList *it; GList *it;
guint32 nums; guint32 nums;
@ -1196,7 +1196,7 @@ void client_update_title(Client *self)
nums = 0; nums = 0;
for (it = client_list; it; it = it->next) for (it = client_list; it; it = it->next)
if (it->data != self) { if (it->data != self) {
Client *c = it->data; ObClient *c = it->data;
if (0 == strncmp(c->title, data, strlen(data))) if (0 == strncmp(c->title, data, strlen(data)))
nums |= 1 << c->title_count; nums |= 1 << c->title_count;
} }
@ -1252,7 +1252,7 @@ void client_update_title(Client *self)
self->icon_title = data; self->icon_title = data;
} }
void client_update_class(Client *self) void client_update_class(ObClient *self)
{ {
char **data; char **data;
char *s; char *s;
@ -1280,7 +1280,7 @@ void client_update_class(Client *self)
if (self->role == NULL) self->role = g_strdup(""); if (self->role == NULL) self->role = g_strdup("");
} }
void client_update_strut(Client *self) void client_update_strut(ObClient *self)
{ {
guint num; guint num;
guint32 *data; guint32 *data;
@ -1301,7 +1301,7 @@ void client_update_strut(Client *self)
screen_update_areas(); screen_update_areas();
} }
void client_update_icons(Client *self) void client_update_icons(ObClient *self)
{ {
guint num; guint num;
guint32 *data; guint32 *data;
@ -1325,7 +1325,7 @@ void client_update_icons(Client *self)
++self->nicons; ++self->nicons;
} }
self->icons = g_new(Icon, self->nicons); self->icons = g_new(ObClientIcon, self->nicons);
/* store the icons */ /* store the icons */
i = 0; i = 0;
@ -1357,7 +1357,7 @@ void client_update_icons(Client *self)
kwm_win_icon, &data, &num)) { kwm_win_icon, &data, &num)) {
if (num == 2) { if (num == 2) {
self->nicons++; self->nicons++;
self->icons = g_new(Icon, self->nicons); self->icons = g_new(ObClientIcon, self->nicons);
xerror_set_ignore(TRUE); xerror_set_ignore(TRUE);
if (!RrPixmapToRGBA(ob_rr_inst, if (!RrPixmapToRGBA(ob_rr_inst,
data[0], data[1], data[0], data[1],
@ -1376,7 +1376,7 @@ void client_update_icons(Client *self)
if ((hints = XGetWMHints(ob_display, self->window))) { if ((hints = XGetWMHints(ob_display, self->window))) {
if (hints->flags & IconPixmapHint) { if (hints->flags & IconPixmapHint) {
self->nicons++; self->nicons++;
self->icons = g_new(Icon, self->nicons); self->icons = g_new(ObClientIcon, self->nicons);
xerror_set_ignore(TRUE); xerror_set_ignore(TRUE);
if (!RrPixmapToRGBA(ob_rr_inst, if (!RrPixmapToRGBA(ob_rr_inst,
hints->icon_pixmap, hints->icon_pixmap,
@ -1398,7 +1398,7 @@ void client_update_icons(Client *self)
frame_adjust_icon(self->frame); frame_adjust_icon(self->frame);
} }
static void client_change_state(Client *self) static void client_change_state(ObClient *self)
{ {
guint32 state[2]; guint32 state[2];
guint32 netstate[10]; guint32 netstate[10];
@ -1437,10 +1437,10 @@ static void client_change_state(Client *self)
frame_adjust_state(self->frame); frame_adjust_state(self->frame);
} }
Client *client_search_focus_tree(Client *self) ObClient *client_search_focus_tree(ObClient *self)
{ {
GSList *it; GSList *it;
Client *ret; ObClient *ret;
for (it = self->transients; it != NULL; it = it->next) { for (it = self->transients; it != NULL; it = it->next) {
if (client_focused(it->data)) return it->data; if (client_focused(it->data)) return it->data;
@ -1449,7 +1449,7 @@ Client *client_search_focus_tree(Client *self)
return NULL; return NULL;
} }
Client *client_search_focus_tree_full(Client *self) ObClient *client_search_focus_tree_full(ObClient *self)
{ {
if (self->transient_for) { if (self->transient_for) {
if (self->transient_for != TRAN_GROUP) { if (self->transient_for != TRAN_GROUP) {
@ -1459,8 +1459,8 @@ Client *client_search_focus_tree_full(Client *self)
gboolean recursed = FALSE; gboolean recursed = FALSE;
for (it = self->group->members; it; it = it->next) for (it = self->group->members; it; it = it->next)
if (!((Client*)it->data)->transient_for) { if (!((ObClient*)it->data)->transient_for) {
Client *c; ObClient *c;
if ((c = client_search_focus_tree_full(it->data))) if ((c = client_search_focus_tree_full(it->data)))
return c; return c;
recursed = TRUE; recursed = TRUE;
@ -1477,7 +1477,7 @@ Client *client_search_focus_tree_full(Client *self)
return client_search_focus_tree(self); return client_search_focus_tree(self);
} }
static StackLayer calc_layer(Client *self) static StackLayer calc_layer(ObClient *self)
{ {
StackLayer l; StackLayer l;
@ -1494,7 +1494,7 @@ static StackLayer calc_layer(Client *self)
return l; return l;
} }
static void client_calc_layer_recursive(Client *self, Client *orig, static void client_calc_layer_recursive(ObClient *self, ObClient *orig,
StackLayer l, gboolean raised) StackLayer l, gboolean raised)
{ {
StackLayer old, own; StackLayer old, own;
@ -1516,10 +1516,10 @@ static void client_calc_layer_recursive(Client *self, Client *orig,
} }
} }
void client_calc_layer(Client *self) void client_calc_layer(ObClient *self)
{ {
StackLayer l; StackLayer l;
Client *orig; ObClient *orig;
orig = self; orig = self;
@ -1531,7 +1531,7 @@ void client_calc_layer(Client *self)
client_calc_layer_recursive(self, orig, l, FALSE); client_calc_layer_recursive(self, orig, l, FALSE);
} }
gboolean client_should_show(Client *self) gboolean client_should_show(ObClient *self)
{ {
if (self->iconic) return FALSE; if (self->iconic) return FALSE;
else if (!(self->desktop == screen_desktop || else if (!(self->desktop == screen_desktop ||
@ -1541,7 +1541,7 @@ gboolean client_should_show(Client *self)
return TRUE; return TRUE;
} }
static void client_showhide(Client *self) static void client_showhide(ObClient *self)
{ {
if (client_should_show(self)) if (client_should_show(self))
@ -1550,12 +1550,12 @@ static void client_showhide(Client *self)
frame_hide(self->frame); frame_hide(self->frame);
} }
gboolean client_normal(Client *self) { gboolean client_normal(ObClient *self) {
return ! (self->type == Type_Desktop || self->type == Type_Dock || return ! (self->type == Type_Desktop || self->type == Type_Dock ||
self->type == Type_Splash); self->type == Type_Splash);
} }
static void client_apply_startup_state(Client *self) static void client_apply_startup_state(ObClient *self)
{ {
/* these are in a carefully crafted order.. */ /* these are in a carefully crafted order.. */
@ -1594,7 +1594,7 @@ static void client_apply_startup_state(Client *self)
*/ */
} }
void client_configure(Client *self, ObCorner anchor, void client_configure(ObClient *self, ObCorner anchor,
int x, int y, int w, int h, int x, int y, int w, int h,
gboolean user, gboolean final) gboolean user, gboolean final)
{ {
@ -1814,7 +1814,7 @@ void client_configure(Client *self, ObCorner anchor,
} }
} }
void client_fullscreen(Client *self, gboolean fs, gboolean savearea) void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea)
{ {
int x, y, w, h; int x, y, w, h;
@ -1872,7 +1872,7 @@ void client_fullscreen(Client *self, gboolean fs, gboolean savearea)
client_focus(self); client_focus(self);
} }
static void client_iconify_recursive(Client *self, static void client_iconify_recursive(ObClient *self,
gboolean iconic, gboolean curdesk) gboolean iconic, gboolean curdesk)
{ {
GSList *it; GSList *it;
@ -1935,7 +1935,7 @@ static void client_iconify_recursive(Client *self,
iconic, curdesk); iconic, curdesk);
} }
void client_iconify(Client *self, gboolean iconic, gboolean curdesk) void client_iconify(ObClient *self, gboolean iconic, gboolean curdesk)
{ {
/* move up the transient chain as far as possible first */ /* move up the transient chain as far as possible first */
self = client_search_top_transient(self); self = client_search_top_transient(self);
@ -1944,7 +1944,7 @@ void client_iconify(Client *self, gboolean iconic, gboolean curdesk)
iconic, curdesk); iconic, curdesk);
} }
void client_maximize(Client *self, gboolean max, int dir, gboolean savearea) void client_maximize(ObClient *self, gboolean max, int dir, gboolean savearea)
{ {
int x, y, w, h; int x, y, w, h;
@ -2046,7 +2046,7 @@ void client_maximize(Client *self, gboolean max, int dir, gboolean savearea)
client_configure(self, OB_CORNER_TOPLEFT, x, y, w, h, TRUE, TRUE); client_configure(self, OB_CORNER_TOPLEFT, x, y, w, h, TRUE, TRUE);
} }
void client_shade(Client *self, gboolean shade) void client_shade(ObClient *self, gboolean shade)
{ {
if ((!(self->functions & Func_Shade) && shade) || /* can't shade */ if ((!(self->functions & Func_Shade) && shade) || /* can't shade */
self->shaded == shade) return; /* already done */ self->shaded == shade) return; /* already done */
@ -2060,7 +2060,7 @@ void client_shade(Client *self, gboolean shade)
frame_adjust_area(self->frame, FALSE, FALSE); frame_adjust_area(self->frame, FALSE, FALSE);
} }
void client_close(Client *self) void client_close(ObClient *self)
{ {
XEvent ce; XEvent ce;
@ -2087,12 +2087,12 @@ void client_close(Client *self)
XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce); XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
} }
void client_kill(Client *self) void client_kill(ObClient *self)
{ {
XKillClient(ob_display, self->window); XKillClient(ob_display, self->window);
} }
void client_set_desktop_recursive(Client *self, void client_set_desktop_recursive(ObClient *self,
guint target, gboolean donthide) guint target, gboolean donthide)
{ {
guint old; guint old;
@ -2135,26 +2135,26 @@ void client_set_desktop_recursive(Client *self,
target, donthide); target, donthide);
} }
void client_set_desktop(Client *self, guint target, gboolean donthide) void client_set_desktop(ObClient *self, guint target, gboolean donthide)
{ {
client_set_desktop_recursive(client_search_top_transient(self), client_set_desktop_recursive(client_search_top_transient(self),
target, donthide); target, donthide);
} }
Client *client_search_modal_child(Client *self) ObClient *client_search_modal_child(ObClient *self)
{ {
GSList *it; GSList *it;
Client *ret; ObClient *ret;
for (it = self->transients; it != NULL; it = it->next) { for (it = self->transients; it != NULL; it = it->next) {
Client *c = it->data; ObClient *c = it->data;
if ((ret = client_search_modal_child(c))) return ret; if ((ret = client_search_modal_child(c))) return ret;
if (c->modal) return c; if (c->modal) return c;
} }
return NULL; return NULL;
} }
gboolean client_validate(Client *self) gboolean client_validate(ObClient *self)
{ {
XEvent e; XEvent e;
@ -2169,7 +2169,7 @@ gboolean client_validate(Client *self)
return TRUE; return TRUE;
} }
void client_set_wm_state(Client *self, long state) void client_set_wm_state(ObClient *self, long state)
{ {
if (state == self->wmstate) return; /* no change */ if (state == self->wmstate) return; /* no change */
@ -2183,7 +2183,7 @@ void client_set_wm_state(Client *self, long state)
} }
} }
void client_set_state(Client *self, Atom action, long data1, long data2) void client_set_state(ObClient *self, Atom action, long data1, long data2)
{ {
gboolean shaded = self->shaded; gboolean shaded = self->shaded;
gboolean fullscreen = self->fullscreen; gboolean fullscreen = self->fullscreen;
@ -2307,9 +2307,9 @@ void client_set_state(Client *self, Atom action, long data1, long data2)
client_change_state(self); /* change the hint to reflect these changes */ client_change_state(self); /* change the hint to reflect these changes */
} }
Client *client_focus_target(Client *self) ObClient *client_focus_target(ObClient *self)
{ {
Client *child; ObClient *child;
/* if we have a modal child, then focus it, not us */ /* if we have a modal child, then focus it, not us */
child = client_search_modal_child(self); child = client_search_modal_child(self);
@ -2317,7 +2317,7 @@ Client *client_focus_target(Client *self)
return self; return self;
} }
gboolean client_can_focus(Client *self) gboolean client_can_focus(ObClient *self)
{ {
XEvent ev; XEvent ev;
@ -2354,7 +2354,7 @@ gboolean client_can_focus(Client *self)
return TRUE; return TRUE;
} }
gboolean client_focus(Client *self) gboolean client_focus(ObClient *self)
{ {
/* choose the correct target */ /* choose the correct target */
self = client_focus_target(self); self = client_focus_target(self);
@ -2402,7 +2402,7 @@ gboolean client_focus(Client *self)
return TRUE; return TRUE;
} }
void client_unfocus(Client *self) void client_unfocus(ObClient *self)
{ {
g_assert(focus_client == self); g_assert(focus_client == self);
#ifdef DEBUG_FOCUS #ifdef DEBUG_FOCUS
@ -2411,7 +2411,7 @@ void client_unfocus(Client *self)
focus_fallback(Fallback_Unfocusing); focus_fallback(Fallback_Unfocusing);
} }
void client_activate(Client *self) void client_activate(ObClient *self)
{ {
if (client_normal(self) && screen_showing_desktop) if (client_normal(self) && screen_showing_desktop)
screen_show_desktop(FALSE); screen_show_desktop(FALSE);
@ -2427,12 +2427,12 @@ void client_activate(Client *self)
stacking_raise(CLIENT_AS_WINDOW(self)); stacking_raise(CLIENT_AS_WINDOW(self));
} }
gboolean client_focused(Client *self) gboolean client_focused(ObClient *self)
{ {
return self == focus_client; return self == focus_client;
} }
Icon *client_icon(Client *self, int w, int h) ObClientIcon *client_icon(ObClient *self, int w, int h)
{ {
int i; int i;
/* si is the smallest image >= req */ /* si is the smallest image >= req */
@ -2458,13 +2458,13 @@ Icon *client_icon(Client *self, int w, int h)
} }
/* this be mostly ripped from fvwm */ /* this be mostly ripped from fvwm */
Client *client_find_directional(Client *c, ObDirection dir) ObClient *client_find_directional(ObClient *c, ObDirection dir)
{ {
int my_cx, my_cy, his_cx, his_cy; int my_cx, my_cy, his_cx, his_cy;
int offset = 0; int offset = 0;
int distance = 0; int distance = 0;
int score, best_score; int score, best_score;
Client *best_client, *cur; ObClient *best_client, *cur;
GList *it; GList *it;
if(!client_list) if(!client_list)
@ -2554,7 +2554,7 @@ Client *client_find_directional(Client *c, ObDirection dir)
return best_client; return best_client;
} }
void client_set_layer(Client *self, int layer) void client_set_layer(ObClient *self, int layer)
{ {
if (layer < 0) { if (layer < 0) {
self->below = TRUE; self->below = TRUE;
@ -2569,7 +2569,7 @@ void client_set_layer(Client *self, int layer)
client_change_state(self); /* reflect this in the state hints */ client_change_state(self); /* reflect this in the state hints */
} }
guint client_monitor(Client *self) guint client_monitor(ObClient *self)
{ {
guint i; guint i;
@ -2583,7 +2583,7 @@ guint client_monitor(Client *self)
return i; return i;
} }
Client *client_search_top_transient(Client *self) ObClient *client_search_top_transient(ObClient *self)
{ {
/* move up the transient chain as far as possible */ /* move up the transient chain as far as possible */
if (self->transient_for) { if (self->transient_for) {
@ -2593,7 +2593,7 @@ Client *client_search_top_transient(Client *self)
GSList *it; GSList *it;
for (it = self->group->members; it; it = it->next) { for (it = self->group->members; it; it = it->next) {
Client *c = it->data; ObClient *c = it->data;
/* checking transient_for prevents infinate loops! */ /* checking transient_for prevents infinate loops! */
if (c != self && !c->transient_for) if (c != self && !c->transient_for)

View file

@ -13,15 +13,20 @@
struct Frame; struct Frame;
struct Group; struct Group;
typedef struct _ObClient ObClient;
typedef struct _ObClientIcon ObClientIcon;
/* The value in client.transient_for indicating it is a transient for its /* The value in client.transient_for indicating it is a transient for its
group instead of for a single window */ group instead of for a single window */
#define TRAN_GROUP ((void*)~0l) #define TRAN_GROUP ((void*)~0l)
/*! Holds an icon in ARGB format */ /*! Holds an icon in ARGB format */
typedef struct Icon { struct _ObClientIcon
int width, height; {
gint width;
gint height;
RrPixel32 *data; RrPixel32 *data;
} Icon; };
/*! Possible window types */ /*! Possible window types */
typedef enum { typedef enum {
@ -61,7 +66,8 @@ typedef enum {
Decor_Close = 1 << 8 /*!< Display a close button */ Decor_Close = 1 << 8 /*!< Display a close button */
} Decoration; } Decoration;
typedef struct Client { struct _ObClient
{
ObWindow obwin; ObWindow obwin;
Window window; Window window;
@ -83,7 +89,7 @@ typedef struct Client {
members of its Group, and is not a valid pointer to be followed in this members of its Group, and is not a valid pointer to be followed in this
case. case.
*/ */
struct Client *transient_for; ObClient *transient_for;
/*! The clients which are transients (children) of this client */ /*! The clients which are transients (children) of this client */
GSList *transients; GSList *transients;
/*! The desktop on which the window resides (0xffffffff for all /*! The desktop on which the window resides (0xffffffff for all
@ -235,10 +241,10 @@ typedef struct Client {
int functions; int functions;
/*! Icons for the client as specified on the client window */ /*! Icons for the client as specified on the client window */
Icon *icons; ObClientIcon *icons;
/*! The number of icons in icons */ /*! The number of icons in icons */
int nicons; int nicons;
} Client; };
extern GList *client_list; extern GList *client_list;
@ -252,7 +258,7 @@ void client_manage(Window win);
/*! Unmanages all managed windows */ /*! Unmanages all managed windows */
void client_unmanage_all(); void client_unmanage_all();
/*! Unmanages a given client */ /*! Unmanages a given client */
void client_unmanage(Client *client); void client_unmanage(ObClient *client);
/*! Sets the client list on the root window from the client_list */ /*! Sets the client list on the root window from the client_list */
void client_set_list(); void client_set_list();
@ -260,15 +266,15 @@ void client_set_list();
/*! Determines if the client should be shown or hidden currently. /*! Determines if the client should be shown or hidden currently.
@return TRUE if it should be visible; otherwise, FALSE. @return TRUE if it should be visible; otherwise, FALSE.
*/ */
gboolean client_should_show(Client *self); gboolean client_should_show(ObClient *self);
/*! Returns if the window should be treated as a normal window. /*! Returns if the window should be treated as a normal window.
Some windows (desktops, docks, splash screens) have special rules applied Some windows (desktops, docks, splash screens) have special rules applied
to them in a number of places regarding focus or user interaction. */ to them in a number of places regarding focus or user interaction. */
gboolean client_normal(Client *self); gboolean client_normal(ObClient *self);
/* Returns if the window is focused */ /* Returns if the window is focused */
gboolean client_focused(Client *self); gboolean client_focused(ObClient *self);
/*! Move and/or resize the window. /*! Move and/or resize the window.
This also maintains things like the client's minsize, and size increments. This also maintains things like the client's minsize, and size increments.
@ -285,16 +291,16 @@ gboolean client_focused(Client *self);
interactive move/resize, and then be TRUE for the last call interactive move/resize, and then be TRUE for the last call
only. only.
*/ */
void client_configure(Client *self, ObCorner anchor, void client_configure(ObClient *self, ObCorner anchor,
int x, int y, int w, int h, int x, int y, int w, int h,
gboolean user, gboolean final); gboolean user, gboolean final);
void client_reconfigure(Client *self); void client_reconfigure(ObClient *self);
/*! Moves a client so that it is on screen if it is entirely out of the /*! Moves a client so that it is on screen if it is entirely out of the
viewable screen. viewable screen.
*/ */
void client_move_onscreen(Client *self); void client_move_onscreen(ObClient *self);
/*! Fullscreen's or unfullscreen's the client window /*! Fullscreen's or unfullscreen's the client window
@param fs true if the window should be made fullscreen; false if it should @param fs true if the window should be made fullscreen; false if it should
@ -304,7 +310,7 @@ void client_move_onscreen(Client *self);
new window that is set to fullscreen. This has no effect new window that is set to fullscreen. This has no effect
when restoring a window from fullscreen. when restoring a window from fullscreen.
*/ */
void client_fullscreen(Client *self, gboolean fs, gboolean savearea); void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea);
/*! Iconifies or uniconifies the client window /*! Iconifies or uniconifies the client window
@param iconic true if the window should be iconified; false if it should be @param iconic true if the window should be iconified; false if it should be
@ -313,7 +319,7 @@ void client_fullscreen(Client *self, gboolean fs, gboolean savearea);
be uniconified to the current viewable desktop (true) or to be uniconified to the current viewable desktop (true) or to
its previous desktop (false) its previous desktop (false)
*/ */
void client_iconify(Client *self, gboolean iconic, gboolean curdesk); void client_iconify(ObClient *self, gboolean iconic, gboolean curdesk);
/*! Maximize or unmaximize the client window /*! Maximize or unmaximize the client window
@param max true if the window should be maximized; false if it should be @param max true if the window should be maximized; false if it should be
@ -324,35 +330,35 @@ void client_iconify(Client *self, gboolean iconic, gboolean curdesk);
new window that is set to fullscreen. This has no effect new window that is set to fullscreen. This has no effect
when unmaximizing a window. when unmaximizing a window.
*/ */
void client_maximize(Client *self, gboolean max, int dir, void client_maximize(ObClient *self, gboolean max, int dir,
gboolean savearea); gboolean savearea);
/*! Shades or unshades the client window /*! Shades or unshades the client window
@param shade true if the window should be shaded; false if it should be @param shade true if the window should be shaded; false if it should be
unshaded. unshaded.
*/ */
void client_shade(Client *self, gboolean shade); void client_shade(ObClient *self, gboolean shade);
/*! Request the client to close its window */ /*! Request the client to close its window */
void client_close(Client *self); void client_close(ObClient *self);
/*! Kill the client off violently */ /*! Kill the client off violently */
void client_kill(Client *self); void client_kill(ObClient *self);
/*! Sends the window to the specified desktop /*! Sends the window to the specified desktop
@param donthide If TRUE, the window will not be shown/hidden after its @param donthide If TRUE, the window will not be shown/hidden after its
desktop has been changed. Generally this should be FALSE. */ desktop has been changed. Generally this should be FALSE. */
void client_set_desktop(Client *self, guint target, gboolean donthide); void client_set_desktop(ObClient *self, guint target, gboolean donthide);
/*! Validate client, by making sure no Destroy or Unmap events exist in /*! Validate client, by making sure no Destroy or Unmap events exist in
the event queue for the window. the event queue for the window.
@return true if the client is valid; false if the client has already @return true if the client is valid; false if the client has already
been unmapped/destroyed, and so is invalid. been unmapped/destroyed, and so is invalid.
*/ */
gboolean client_validate(Client *self); gboolean client_validate(ObClient *self);
/*! Sets the wm_state to the specified value */ /*! Sets the wm_state to the specified value */
void client_set_wm_state(Client *self, long state); void client_set_wm_state(ObClient *self, long state);
/*! Adjusts the window's net_state /*! Adjusts the window's net_state
This should not be called as part of the window mapping process! It is for This should not be called as part of the window mapping process! It is for
@ -360,94 +366,94 @@ void client_set_wm_state(Client *self, long state);
client_apply_startup_state is used to do the same things during the mapping client_apply_startup_state is used to do the same things during the mapping
process. process.
*/ */
void client_set_state(Client *self, Atom action, long data1, long data2); void client_set_state(ObClient *self, Atom action, long data1, long data2);
/* Given a Client, find the client that focus would actually be sent to if /* Given a ObClient, find the client that focus would actually be sent to if
you wanted to give focus to the specified Client. Will return the same you wanted to give focus to the specified ObClient. Will return the same
Client passed to it or another Client if appropriate. */ ObClient passed to it or another ObClient if appropriate. */
Client *client_focus_target(Client *self); ObClient *client_focus_target(ObClient *self);
/*! Returns what client_focus would return if passed the same client, but /*! Returns what client_focus would return if passed the same client, but
without focusing it or modifying the focus order lists. */ without focusing it or modifying the focus order lists. */
gboolean client_can_focus(Client *self); gboolean client_can_focus(ObClient *self);
/*! Attempt to focus the client window */ /*! Attempt to focus the client window */
gboolean client_focus(Client *self); gboolean client_focus(ObClient *self);
/*! Remove focus from the client window */ /*! Remove focus from the client window */
void client_unfocus(Client *self); void client_unfocus(ObClient *self);
/*! Activates the client for use, focusing, uniconifying it, etc. To be used /*! Activates the client for use, focusing, uniconifying it, etc. To be used
when the user deliberately selects a window for use. */ when the user deliberately selects a window for use. */
void client_activate(Client *self); void client_activate(ObClient *self);
/*! Calculates the stacking layer for the client window */ /*! Calculates the stacking layer for the client window */
void client_calc_layer(Client *self); void client_calc_layer(ObClient *self);
/*! Updates the window's transient status, and any parents of it */ /*! Updates the window's transient status, and any parents of it */
void client_update_transient_for(Client *self); void client_update_transient_for(ObClient *self);
/*! Update the protocols that the window supports and adjusts things if they /*! Update the protocols that the window supports and adjusts things if they
change */ change */
void client_update_protocols(Client *self); void client_update_protocols(ObClient *self);
/*! Updates the WMNormalHints and adjusts things if they change */ /*! Updates the WMNormalHints and adjusts things if they change */
void client_update_normal_hints(Client *self); void client_update_normal_hints(ObClient *self);
/*! Updates the WMHints and adjusts things if they change /*! Updates the WMHints and adjusts things if they change
@param initstate Whether to read the initial_state property from the @param initstate Whether to read the initial_state property from the
WMHints. This should only be used during the mapping WMHints. This should only be used during the mapping
process. process.
*/ */
void client_update_wmhints(Client *self); void client_update_wmhints(ObClient *self);
/*! Updates the window's title and icon title */ /*! Updates the window's title and icon title */
void client_update_title(Client *self); void client_update_title(ObClient *self);
/*! Updates the window's application name and class */ /*! Updates the window's application name and class */
void client_update_class(Client *self); void client_update_class(ObClient *self);
/*! Updates the strut for the client */ /*! Updates the strut for the client */
void client_update_strut(Client *self); void client_update_strut(ObClient *self);
/*! Updates the window's icons */ /*! Updates the window's icons */
void client_update_icons(Client *self); void client_update_icons(ObClient *self);
/*! Set up what decor should be shown on the window and what functions should /*! Set up what decor should be shown on the window and what functions should
be allowed (Client::decorations and Client::functions). be allowed (ObClient::decorations and ObClient::functions).
This also updates the NET_WM_ALLOWED_ACTIONS hint. This also updates the NET_WM_ALLOWED_ACTIONS hint.
*/ */
void client_setup_decor_and_functions(Client *self); void client_setup_decor_and_functions(ObClient *self);
/*! Retrieves the window's type and sets Client->type */ /*! Retrieves the window's type and sets ObClient->type */
void client_get_type(Client *self); void client_get_type(ObClient *self);
Icon *client_icon(Client *self, int w, int h); ObClientIcon *client_icon(ObClient *self, int w, int h);
/*! Searches a client's transients for a focused window. The function does not /*! Searches a client's transients for a focused window. The function does not
check for the passed client, only for its transients. check for the passed client, only for its transients.
If no focused transient is found, NULL is returned. If no focused transient is found, NULL is returned.
*/ */
Client *client_search_focus_tree(Client *self); ObClient *client_search_focus_tree(ObClient *self);
/*! Searches a client's transient tree for a focused window. The function /*! Searches a client's transient tree for a focused window. The function
searches up the tree and down other branches as well as the passed client's. searches up the tree and down other branches as well as the passed client's.
If no focused client is found, NULL is returned. If no focused client is found, NULL is returned.
*/ */
Client *client_search_focus_tree_full(Client *self); ObClient *client_search_focus_tree_full(ObClient *self);
/*! Return a modal child of the client window that can be focused. /*! Return a modal child of the client window that can be focused.
@return A modal child of the client window that can be focused, or 0 if @return A modal child of the client window that can be focused, or 0 if
none was found. none was found.
*/ */
Client *client_search_modal_child(Client *self); ObClient *client_search_modal_child(ObClient *self);
Client *client_search_top_transient(Client *self); ObClient *client_search_top_transient(ObClient *self);
/*! Return the "closest" client in the given direction */ /*! Return the "closest" client in the given direction */
Client *client_find_directional(Client *c, ObDirection dir); ObClient *client_find_directional(ObClient *c, ObDirection dir);
/*! Set a client window to be above/below other clients. /*! Set a client window to be above/below other clients.
@layer < 0 indicates the client should be placed below other clients.<br> @layer < 0 indicates the client should be placed below other clients.<br>
= 0 indicates the client should be placed with other clients.<br> = 0 indicates the client should be placed with other clients.<br>
> 0 indicates the client should be placed above other clients. > 0 indicates the client should be placed above other clients.
*/ */
void client_set_layer(Client *self, int layer); void client_set_layer(ObClient *self, int layer);
guint client_monitor(Client *self); guint client_monitor(ObClient *self);
#endif #endif

View file

@ -84,7 +84,7 @@ void dispatch_register(EventMask mask, EventHandler h, void *data)
} }
} }
void dispatch_x(XEvent *xe, Client *c) void dispatch_x(XEvent *xe, ObClient *c)
{ {
EventType e; EventType e;
guint i; guint i;
@ -141,7 +141,7 @@ void dispatch_x(XEvent *xe, Client *c)
} }
} }
void dispatch_client(EventType e, Client *c, int num0, int num1) void dispatch_client(EventType e, ObClient *c, int num0, int num1)
{ {
guint i; guint i;
GSList *it; GSList *it;
@ -211,7 +211,7 @@ void dispatch_signal(int signal)
} }
} }
void dispatch_move(Client *c, int *x, int *y) void dispatch_move(ObClient *c, int *x, int *y)
{ {
guint i; guint i;
GSList *it; GSList *it;
@ -238,7 +238,7 @@ void dispatch_move(Client *c, int *x, int *y)
*y = obe.data.c.num[1]; *y = obe.data.c.num[1];
} }
void dispatch_resize(Client *c, int *w, int *h, ObCorner corner) void dispatch_resize(ObClient *c, int *w, int *h, ObCorner corner)
{ {
guint i; guint i;
GSList *it; GSList *it;

View file

@ -41,23 +41,23 @@ typedef enum {
typedef struct { typedef struct {
XEvent *e; XEvent *e;
Client *client; ObClient *client;
} EventData_X; } EventData_X;
typedef struct { typedef struct {
Client *client; ObClient *client;
int num[3]; int num[3];
/* Event_Client_Desktop: num[0] = new number, num[1] = old number /* Event_ObClient_Desktop: num[0] = new number, num[1] = old number
Event_Client_Urgent: num[0] = urgent state Event_ObClient_Urgent: num[0] = urgent state
Event_Client_Moving: num[0] = dest x coord, num[1] = dest y coord -- Event_ObClient_Moving: num[0] = dest x coord, num[1] = dest y coord --
change these in the handler to adjust where the change these in the handler to adjust where the
window will be placed window will be placed
Event_Client_Resizing: num[0] = dest width, num[1] = dest height -- Event_ObClient_Resizing: num[0] = dest width, num[1] = dest height --
change these in the handler to adjust where the change these in the handler to adjust where the
window will be placed window will be placed
num[2] = the anchored corner num[2] = the anchored corner
*/ */
} EventData_Client; } EventData_ObClient;
typedef struct { typedef struct {
int num[2]; int num[2];
@ -73,7 +73,7 @@ typedef struct {
typedef struct { typedef struct {
EventData_X x; /* for Event_X_* event types */ EventData_X x; /* for Event_X_* event types */
EventData_Client c; /* for Event_Client_* event types */ EventData_ObClient c; /* for Event_ObClient_* event types */
EventData_Ob o; /* for Event_Ob_* event types */ EventData_Ob o; /* for Event_Ob_* event types */
EventData_Signal s; /* for Event_Signal */ EventData_Signal s; /* for Event_Signal */
} EventData; } EventData;
@ -89,15 +89,15 @@ typedef unsigned int EventMask;
void dispatch_register(EventMask mask, EventHandler h, void *data); void dispatch_register(EventMask mask, EventHandler h, void *data);
void dispatch_x(XEvent *e, Client *c); void dispatch_x(XEvent *e, ObClient *c);
void dispatch_client(EventType e, Client *c, int num0, int num1); void dispatch_client(EventType e, ObClient *c, int num0, int num1);
void dispatch_ob(EventType e, int num0, int num1); void dispatch_ob(EventType e, int num0, int num1);
void dispatch_signal(int signal); void dispatch_signal(int signal);
/* *x and *y should be set with the destination of the window, they may be /* *x and *y should be set with the destination of the window, they may be
changed by the event handlers */ changed by the event handlers */
void dispatch_move(Client *c, int *x, int *y); void dispatch_move(ObClient *c, int *x, int *y);
/* *w and *h should be set with the destination of the window, they may be /* *w and *h should be set with the destination of the window, they may be
changed by the event handlers */ changed by the event handlers */
void dispatch_resize(Client *c, int *w, int *h, ObCorner corner); void dispatch_resize(ObClient *c, int *w, int *h, ObCorner corner);
#endif #endif

View file

@ -40,8 +40,8 @@ static void event_process(XEvent *e);
static void event_handle_root(XEvent *e); static void event_handle_root(XEvent *e);
static void event_handle_dock(Dock *s, XEvent *e); static void event_handle_dock(Dock *s, XEvent *e);
static void event_handle_dockapp(DockApp *app, XEvent *e); static void event_handle_dockapp(DockApp *app, XEvent *e);
static void event_handle_client(Client *c, XEvent *e); static void event_handle_client(ObClient *c, XEvent *e);
static void event_handle_menu(Client *c, XEvent *e); static void event_handle_menu(ObClient *c, XEvent *e);
static void fd_event_handle(); static void fd_event_handle();
#ifdef USE_SM #ifdef USE_SM
static void ice_watch(IceConn conn, IcePointer data, Bool opening, static void ice_watch(IceConn conn, IcePointer data, Bool opening,
@ -320,7 +320,7 @@ static void event_hack_mods(XEvent *e)
} }
} }
static gboolean event_ignore(XEvent *e, Client *client) static gboolean event_ignore(XEvent *e, ObClient *client)
{ {
switch(e->type) { switch(e->type) {
case FocusIn: case FocusIn:
@ -467,7 +467,7 @@ static gboolean event_ignore(XEvent *e, Client *client)
static void event_process(XEvent *e) static void event_process(XEvent *e)
{ {
Window window; Window window;
Client *client = NULL; ObClient *client = NULL;
Dock *dock = NULL; Dock *dock = NULL;
DockApp *dockapp = NULL; DockApp *dockapp = NULL;
Menu *menu = NULL; Menu *menu = NULL;
@ -607,7 +607,7 @@ static void event_handle_root(XEvent *e)
} }
} }
static void event_handle_client(Client *client, XEvent *e) static void event_handle_client(ObClient *client, XEvent *e)
{ {
XEvent ce; XEvent ce;
Atom msgtype; Atom msgtype;
@ -982,7 +982,7 @@ static void event_handle_client(Client *client, XEvent *e)
} }
} }
static void event_handle_menu(Client *client, XEvent *e) static void event_handle_menu(ObClient *client, XEvent *e)
{ {
static MenuEntry *over = NULL; static MenuEntry *over = NULL;
MenuEntry *entry; MenuEntry *entry;

View file

@ -17,13 +17,13 @@
#include <glib.h> #include <glib.h>
#include <assert.h> #include <assert.h>
Client *focus_client = NULL; ObClient *focus_client = NULL;
GList **focus_order = NULL; /* these lists are created when screen_startup GList **focus_order = NULL; /* these lists are created when screen_startup
sets the number of desktops */ sets the number of desktops */
Window focus_backup = None; Window focus_backup = None;
static Client *focus_cycle_target = NULL; static ObClient *focus_cycle_target = NULL;
static Popup *focus_cycle_popup = NULL; static Popup *focus_cycle_popup = NULL;
void focus_startup() void focus_startup()
@ -69,7 +69,7 @@ void focus_shutdown()
event_lasttime); event_lasttime);
} }
static void push_to_top(Client *client) static void push_to_top(ObClient *client)
{ {
guint desktop; guint desktop;
@ -79,10 +79,10 @@ static void push_to_top(Client *client)
focus_order[desktop] = g_list_prepend(focus_order[desktop], client); focus_order[desktop] = g_list_prepend(focus_order[desktop], client);
} }
void focus_set_client(Client *client) void focus_set_client(ObClient *client)
{ {
Window active; Window active;
Client *old; ObClient *old;
#ifdef DEBUG_FOCUS #ifdef DEBUG_FOCUS
g_message("focus_set_client 0x%lx", client ? client->window : 0); g_message("focus_set_client 0x%lx", client ? client->window : 0);
@ -130,7 +130,7 @@ static gboolean focus_under_pointer()
if (ob_pointer_pos(&x, &y)) { if (ob_pointer_pos(&x, &y)) {
for (it = stacking_list; it != NULL; it = it->next) { for (it = stacking_list; it != NULL; it = it->next) {
if (WINDOW_IS_CLIENT(it->data)) { if (WINDOW_IS_CLIENT(it->data)) {
Client *c = WINDOW_AS_CLIENT(it->data); ObClient *c = WINDOW_AS_CLIENT(it->data);
if (c->desktop == screen_desktop && if (c->desktop == screen_desktop &&
RECT_CONTAINS(c->frame->area, x, y)) RECT_CONTAINS(c->frame->area, x, y))
break; break;
@ -146,10 +146,10 @@ static gboolean focus_under_pointer()
/* finds the first transient that isn't 'skip' and ensure's that client_normal /* finds the first transient that isn't 'skip' and ensure's that client_normal
is true for it */ is true for it */
static Client *find_transient_recursive(Client *c, Client *top, Client *skip) static ObClient *find_transient_recursive(ObClient *c, ObClient *top, ObClient *skip)
{ {
GSList *it; GSList *it;
Client *ret; ObClient *ret;
for (it = c->transients; it; it = it->next) { for (it = c->transients; it; it = it->next) {
if (it->data == top) return NULL; if (it->data == top) return NULL;
@ -160,9 +160,9 @@ static Client *find_transient_recursive(Client *c, Client *top, Client *skip)
return NULL; return NULL;
} }
static gboolean focus_fallback_transient(Client *top, Client *old) static gboolean focus_fallback_transient(ObClient *top, ObClient *old)
{ {
Client *target = find_transient_recursive(top, top, old); ObClient *target = find_transient_recursive(top, top, old);
if (!target) { if (!target) {
/* make sure client_normal is true always */ /* make sure client_normal is true always */
if (!client_normal(top)) if (!client_normal(top))
@ -175,7 +175,7 @@ static gboolean focus_fallback_transient(Client *top, Client *old)
void focus_fallback(FallbackType type) void focus_fallback(FallbackType type)
{ {
GList *it; GList *it;
Client *old = NULL; ObClient *old = NULL;
old = focus_client; old = focus_client;
@ -231,7 +231,7 @@ void focus_fallback(FallbackType type)
/* dont fall back to 'anonymous' fullscreen windows. theres no /* dont fall back to 'anonymous' fullscreen windows. theres no
checks for this is in transient/group fallbacks, so they can checks for this is in transient/group fallbacks, so they can
be fallback targets there. */ be fallback targets there. */
!((Client*)it->data)->fullscreen && !((ObClient*)it->data)->fullscreen &&
client_can_focus(it->data)) { client_can_focus(it->data)) {
gboolean r = client_focus(it->data); gboolean r = client_focus(it->data);
assert(r); assert(r);
@ -241,13 +241,13 @@ void focus_fallback(FallbackType type)
/* nothing to focus, and already set it to none above */ /* nothing to focus, and already set it to none above */
} }
static void popup_cycle(Client *c, gboolean show) static void popup_cycle(ObClient *c, gboolean show)
{ {
if (!show) { if (!show) {
popup_hide(focus_cycle_popup); popup_hide(focus_cycle_popup);
} else { } else {
Rect *a; Rect *a;
Client *p = c; ObClient *p = c;
char *title; char *title;
a = screen_physical_area_monitor(0); a = screen_physical_area_monitor(0);
@ -280,14 +280,14 @@ static void popup_cycle(Client *c, gboolean show)
} }
} }
Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done,
gboolean cancel) gboolean cancel)
{ {
static Client *first = NULL; static ObClient *first = NULL;
static Client *t = NULL; static ObClient *t = NULL;
static GList *order = NULL; static GList *order = NULL;
GList *it, *start, *list; GList *it, *start, *list;
Client *ft; ObClient *ft;
if (cancel) { if (cancel) {
if (focus_cycle_target) if (focus_cycle_target)
@ -355,7 +355,7 @@ done_cycle:
return NULL; return NULL;
} }
void focus_order_add_new(Client *c) void focus_order_add_new(ObClient *c)
{ {
guint d, i; guint d, i;
@ -365,20 +365,20 @@ void focus_order_add_new(Client *c)
d = c->desktop; d = c->desktop;
if (d == DESKTOP_ALL) { if (d == DESKTOP_ALL) {
for (i = 0; i < screen_num_desktops; ++i) { for (i = 0; i < screen_num_desktops; ++i) {
if (focus_order[i] && ((Client*)focus_order[i]->data)->iconic) if (focus_order[i] && ((ObClient*)focus_order[i]->data)->iconic)
focus_order[i] = g_list_insert(focus_order[i], c, 0); focus_order[i] = g_list_insert(focus_order[i], c, 0);
else else
focus_order[i] = g_list_insert(focus_order[i], c, 1); focus_order[i] = g_list_insert(focus_order[i], c, 1);
} }
} else } else
if (focus_order[d] && ((Client*)focus_order[d]->data)->iconic) if (focus_order[d] && ((ObClient*)focus_order[d]->data)->iconic)
focus_order[d] = g_list_insert(focus_order[d], c, 0); focus_order[d] = g_list_insert(focus_order[d], c, 0);
else else
focus_order[d] = g_list_insert(focus_order[d], c, 1); focus_order[d] = g_list_insert(focus_order[d], c, 1);
} }
} }
void focus_order_remove(Client *c) void focus_order_remove(ObClient *c)
{ {
guint d, i; guint d, i;
@ -390,7 +390,7 @@ void focus_order_remove(Client *c)
focus_order[d] = g_list_remove(focus_order[d], c); focus_order[d] = g_list_remove(focus_order[d], c);
} }
static void to_top(Client *c, guint d) static void to_top(ObClient *c, guint d)
{ {
focus_order[d] = g_list_remove(focus_order[d], c); focus_order[d] = g_list_remove(focus_order[d], c);
if (!c->iconic) { if (!c->iconic) {
@ -400,12 +400,12 @@ static void to_top(Client *c, guint d)
/* insert before first iconic window */ /* insert before first iconic window */
for (it = focus_order[d]; for (it = focus_order[d];
it && !((Client*)it->data)->iconic; it = it->next); it && !((ObClient*)it->data)->iconic; it = it->next);
g_list_insert_before(focus_order[d], it, c); g_list_insert_before(focus_order[d], it, c);
} }
} }
void focus_order_to_top(Client *c) void focus_order_to_top(ObClient *c)
{ {
guint d, i; guint d, i;
@ -417,7 +417,7 @@ void focus_order_to_top(Client *c)
to_top(c, d); to_top(c, d);
} }
static void to_bottom(Client *c, guint d) static void to_bottom(ObClient *c, guint d)
{ {
focus_order[d] = g_list_remove(focus_order[d], c); focus_order[d] = g_list_remove(focus_order[d], c);
if (c->iconic) { if (c->iconic) {
@ -427,12 +427,12 @@ static void to_bottom(Client *c, guint d)
/* insert before first iconic window */ /* insert before first iconic window */
for (it = focus_order[d]; for (it = focus_order[d];
it && !((Client*)it->data)->iconic; it = it->next); it && !((ObClient*)it->data)->iconic; it = it->next);
g_list_insert_before(focus_order[d], it, c); g_list_insert_before(focus_order[d], it, c);
} }
} }
void focus_order_to_bottom(Client *c) void focus_order_to_bottom(ObClient *c)
{ {
guint d, i; guint d, i;

View file

@ -4,13 +4,13 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <glib.h> #include <glib.h>
struct Client; struct _ObClient;
/*! The window which gets focus when nothing else will be focused */ /*! The window which gets focus when nothing else will be focused */
extern Window focus_backup; extern Window focus_backup;
/*! The client which is currently focused */ /*! The client which is currently focused */
extern struct Client *focus_client; extern struct _ObClient *focus_client;
/*! The recent focus order on each desktop */ /*! The recent focus order on each desktop */
extern GList **focus_order; extern GList **focus_order;
@ -20,7 +20,7 @@ void focus_shutdown();
/*! Specify which client is currently focused, this doesn't actually /*! Specify which client is currently focused, this doesn't actually
send focus anywhere, its called by the Focus event handlers */ send focus anywhere, its called by the Focus event handlers */
void focus_set_client(struct Client *client); void focus_set_client(struct _ObClient *client);
typedef enum { typedef enum {
Fallback_Desktop, /* switching desktops */ Fallback_Desktop, /* switching desktops */
@ -32,21 +32,21 @@ typedef enum {
void focus_fallback(FallbackType type); void focus_fallback(FallbackType type);
/*! Cycle focus amongst windows /*! Cycle focus amongst windows
Returns the Client to which focus has been cycled, or NULL if none. */ Returns the _ObClient to which focus has been cycled, or NULL if none. */
struct Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, struct _ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done,
gboolean cancel); gboolean cancel);
/*! Add a new client into the focus order */ /*! Add a new client into the focus order */
void focus_order_add_new(struct Client *c); void focus_order_add_new(struct _ObClient *c);
/*! Remove a client from the focus order */ /*! Remove a client from the focus order */
void focus_order_remove(struct Client *c); void focus_order_remove(struct _ObClient *c);
/*! Move a client to the top of the focus order */ /*! Move a client to the top of the focus order */
void focus_order_to_top(struct Client *c); void focus_order_to_top(struct _ObClient *c);
/*! Move a client to the bottom of the focus order (keeps iconic windows at the /*! Move a client to the bottom of the focus order (keeps iconic windows at the
very bottom always though). */ very bottom always though). */
void focus_order_to_bottom(struct Client *c); void focus_order_to_bottom(struct _ObClient *c);
#endif #endif

View file

@ -330,7 +330,7 @@ void frame_adjust_icon(Frame *self)
framerender_frame(self); framerender_frame(self);
} }
void frame_grab_client(Frame *self, Client *client) void frame_grab_client(Frame *self, ObClient *client)
{ {
self->client = client; self->client = client;
@ -372,7 +372,7 @@ void frame_grab_client(Frame *self, Client *client)
g_hash_table_insert(window_map, &self->rgrip, client); g_hash_table_insert(window_map, &self->rgrip, client);
} }
void frame_release_client(Frame *self, Client *client) void frame_release_client(Frame *self, ObClient *client)
{ {
XEvent ev; XEvent ev;
@ -578,7 +578,7 @@ Context frame_context_from_string(char *name)
return Context_None; return Context_None;
} }
Context frame_context(Client *client, Window win) Context frame_context(ObClient *client, Window win)
{ {
Frame *self; Frame *self;

View file

@ -29,7 +29,7 @@ typedef enum {
f->cbwidth) f->cbwidth)
typedef struct Frame { typedef struct Frame {
Client *client; ObClient *client;
Window window; Window window;
Window plate; Window plate;
@ -96,12 +96,12 @@ void frame_adjust_state(Frame *self);
void frame_adjust_focus(Frame *self, gboolean hilite); void frame_adjust_focus(Frame *self, gboolean hilite);
void frame_adjust_title(Frame *self); void frame_adjust_title(Frame *self);
void frame_adjust_icon(Frame *self); void frame_adjust_icon(Frame *self);
void frame_grab_client(Frame *self, Client *client); void frame_grab_client(Frame *self, ObClient *client);
void frame_release_client(Frame *self, Client *client); void frame_release_client(Frame *self, ObClient *client);
Context frame_context_from_string(char *name); Context frame_context_from_string(char *name);
Context frame_context(Client *self, Window win); Context frame_context(ObClient *self, Window win);
/*! Applies gravity to the client's position to find where the frame should /*! Applies gravity to the client's position to find where the frame should
be positioned. be positioned.

View file

@ -158,7 +158,7 @@ static void framerender_icon(Frame *self, RrAppearance *a)
if (self->icon_x < 0) return; if (self->icon_x < 0) return;
if (self->client->nicons) { if (self->client->nicons) {
Icon *icon = client_icon(self->client, ObClientIcon *icon = client_icon(self->client,
ob_rr_theme->button_size + 2, ob_rr_theme->button_size + 2,
ob_rr_theme->button_size + 2); ob_rr_theme->button_size + 2);
a->texture[0].type = RR_TEXTURE_RGBA; a->texture[0].type = RR_TEXTURE_RGBA;

View file

@ -17,7 +17,7 @@ void group_shutdown()
g_hash_table_destroy(group_map); g_hash_table_destroy(group_map);
} }
Group *group_add(Window leader, Client *client) Group *group_add(Window leader, ObClient *client)
{ {
Group *self; Group *self;
@ -34,7 +34,7 @@ Group *group_add(Window leader, Client *client)
return self; return self;
} }
void group_remove(Group *self, Client *client) void group_remove(Group *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) {

View file

@ -4,7 +4,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <glib.h> #include <glib.h>
struct Client; struct _ObClient;
typedef struct Group { typedef struct Group {
Window leader; Window leader;
@ -18,8 +18,8 @@ extern GHashTable *group_map;
void group_startup(); void group_startup();
void group_shutdown(); void group_shutdown();
Group *group_add(Window leader, struct Client *client); Group *group_add(Window leader, struct _ObClient *client);
void group_remove(Group *self, struct Client *client); void group_remove(Group *self, struct _ObClient *client);
#endif #endif

View file

@ -61,7 +61,7 @@ parse_menu_fail:
g_free(title); g_free(title);
} }
void menu_control_show(Menu *self, int x, int y, Client *client); void menu_control_show(Menu *self, int x, int y, ObClient *client);
void menu_destroy_hash_key(Menu *menu) void menu_destroy_hash_key(Menu *menu)
{ {
@ -288,7 +288,7 @@ void menu_add_entry(Menu *menu, MenuEntry *entry)
g_hash_table_insert(window_map, &entry->item, menu); g_hash_table_insert(window_map, &entry->item, menu);
} }
void menu_show(char *name, int x, int y, Client *client) void menu_show(char *name, int x, int y, ObClient *client)
{ {
Menu *self; Menu *self;
@ -302,7 +302,7 @@ void menu_show(char *name, int x, int y, Client *client)
menu_show_full(self, x, y, client); menu_show_full(self, x, y, client);
} }
void menu_show_full(Menu *self, int x, int y, Client *client) void menu_show_full(Menu *self, int x, int y, ObClient *client)
{ {
g_assert(self != NULL); g_assert(self != NULL);
@ -397,7 +397,7 @@ void menu_entry_fire(MenuEntry *self)
Default menu controller action for showing. Default menu controller action for showing.
*/ */
void menu_control_show(Menu *self, int x, int y, Client *client) { void menu_control_show(Menu *self, int x, int y, ObClient *client) {
guint i; guint i;
Rect *a = NULL; Rect *a = NULL;

View file

@ -10,7 +10,8 @@
struct Menu; struct Menu;
struct MenuEntry; struct MenuEntry;
typedef void(*menu_controller_show)(struct Menu *self, int x, int y, Client *); typedef void(*menu_controller_show)(struct Menu *self,
int x, int y, ObClient *);
typedef void(*menu_controller_update)(struct Menu *self); typedef void(*menu_controller_update)(struct Menu *self);
typedef void(*menu_controller_mouseover)(struct MenuEntry *self, typedef void(*menu_controller_mouseover)(struct MenuEntry *self,
gboolean enter); gboolean enter);
@ -44,7 +45,7 @@ typedef struct Menu {
/* render stuff */ /* render stuff */
Client *client; ObClient *client;
Window frame; Window frame;
Window title; Window title;
RrAppearance *a_title; RrAppearance *a_title;
@ -103,8 +104,8 @@ Menu *menu_new_full(char *label, char *name, Menu *parent,
menu_controller_show show, menu_controller_update update); menu_controller_show show, menu_controller_update update);
void menu_free(char *name); void menu_free(char *name);
void menu_show(char *name, int x, int y, Client *client); void menu_show(char *name, int x, int y, ObClient *client);
void menu_show_full(Menu *menu, int x, int y, Client *client); void menu_show_full(Menu *menu, int x, int y, ObClient *client);
void menu_hide(Menu *self); void menu_hide(Menu *self);

View file

@ -14,7 +14,7 @@
#include <glib.h> #include <glib.h>
gboolean moveresize_in_progress = FALSE; gboolean moveresize_in_progress = FALSE;
Client *moveresize_client = NULL; ObClient *moveresize_client = NULL;
static gboolean moving = FALSE; /* TRUE - moving, FALSE - resizing */ static gboolean moving = FALSE; /* TRUE - moving, FALSE - resizing */
@ -79,7 +79,7 @@ static void popup_coords(char *format, int a, int b)
g_free(text); g_free(text);
} }
void moveresize_start(Client *c, int x, int y, guint b, guint32 cnr) void moveresize_start(ObClient *c, int x, int y, guint b, guint32 cnr)
{ {
ObCursor cur; ObCursor cur;
Rect *a; Rect *a;

View file

@ -6,12 +6,12 @@
#include <glib.h> #include <glib.h>
extern gboolean moveresize_in_progress; extern gboolean moveresize_in_progress;
extern Client *moveresize_client; extern ObClient *moveresize_client;
void moveresize_startup(); void moveresize_startup();
void moveresize_shutdown(); void moveresize_shutdown();
void moveresize_start(Client *c, int x, int y, guint button, guint32 corner); void moveresize_start(ObClient *c, int x, int y, guint button, guint32 corner);
void moveresize_end(gboolean cancel); void moveresize_end(gboolean cancel);
void moveresize_event(XEvent *e); void moveresize_event(XEvent *e);

View file

@ -105,7 +105,7 @@ void popup_size_to_string(Popup *self, char *text)
self->w = textw + iconw + ob_rr_theme->bevel * (self->hasicon ? 3 : 2); self->w = textw + iconw + ob_rr_theme->bevel * (self->hasicon ? 3 : 2);
} }
void popup_show(Popup *self, char *text, Icon *icon) void popup_show(Popup *self, char *text, ObClientIcon *icon)
{ {
int x, y, w, h; int x, y, w, h;
int textw, texth; int textw, texth;

View file

@ -19,7 +19,7 @@ void popup_position(Popup *self, int gravity, int x, int y);
void popup_size(Popup *self, int w, int h); void popup_size(Popup *self, int w, int h);
void popup_size_to_string(Popup *self, char *text); void popup_size_to_string(Popup *self, char *text);
void popup_show(Popup *self, char *text, Icon *icon); void popup_show(Popup *self, char *text, ObClientIcon *icon);
void popup_hide(Popup *self); void popup_hide(Popup *self);
#endif #endif

View file

@ -292,7 +292,7 @@ void screen_set_num_desktops(guint num)
/* move windows on desktops that will no longer exist! */ /* move windows on desktops that will no longer exist! */
for (it = client_list; it != NULL; it = it->next) { for (it = client_list; it != NULL; it = it->next) {
Client *c = it->data; ObClient *c = it->data;
if (c->desktop >= num && c->desktop != DESKTOP_ALL) if (c->desktop >= num && c->desktop != DESKTOP_ALL)
client_set_desktop(c, num - 1, FALSE); client_set_desktop(c, num - 1, FALSE);
} }
@ -328,7 +328,7 @@ void screen_set_desktop(guint num)
/* show windows from top to bottom */ /* show windows from top to bottom */
for (it = stacking_list; it != NULL; it = it->next) { for (it = stacking_list; it != NULL; it = it->next) {
if (WINDOW_IS_CLIENT(it->data)) { if (WINDOW_IS_CLIENT(it->data)) {
Client *c = it->data; ObClient *c = it->data;
if (!c->frame->visible && client_should_show(c)) if (!c->frame->visible && client_should_show(c))
frame_show(c->frame); frame_show(c->frame);
} }
@ -337,7 +337,7 @@ void screen_set_desktop(guint num)
/* hide windows from bottom to top */ /* hide windows from bottom to top */
for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { for (it = g_list_last(stacking_list); it != NULL; it = it->prev) {
if (WINDOW_IS_CLIENT(it->data)) { if (WINDOW_IS_CLIENT(it->data)) {
Client *c = it->data; ObClient *c = it->data;
if (c->frame->visible && !client_should_show(c)) if (c->frame->visible && !client_should_show(c))
frame_hide(c->frame); frame_hide(c->frame);
} }
@ -466,7 +466,7 @@ void screen_show_desktop(gboolean show)
/* bottom to top */ /* bottom to top */
for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { for (it = g_list_last(stacking_list); it != NULL; it = it->prev) {
if (WINDOW_IS_CLIENT(it->data)) { if (WINDOW_IS_CLIENT(it->data)) {
Client *client = it->data; ObClient *client = it->data;
if (client->frame->visible && !client_should_show(client)) if (client->frame->visible && !client_should_show(client))
frame_hide(client->frame); frame_hide(client->frame);
} }
@ -475,7 +475,7 @@ void screen_show_desktop(gboolean show)
/* top to bottom */ /* top to bottom */
for (it = stacking_list; it != NULL; it = it->next) { for (it = stacking_list; it != NULL; it = it->next) {
if (WINDOW_IS_CLIENT(it->data)) { if (WINDOW_IS_CLIENT(it->data)) {
Client *client = it->data; ObClient *client = it->data;
if (!client->frame->visible && client_should_show(client)) if (!client->frame->visible && client_should_show(client))
frame_show(client->frame); frame_show(client->frame);
} }
@ -485,7 +485,7 @@ void screen_show_desktop(gboolean show)
if (show) { if (show) {
/* focus desktop */ /* focus desktop */
for (it = focus_order[screen_desktop]; it; it = it->next) for (it = focus_order[screen_desktop]; it; it = it->next)
if (((Client*)it->data)->type == Type_Desktop && if (((ObClient*)it->data)->type == Type_Desktop &&
client_focus(it->data)) client_focus(it->data))
break; break;
} else { } else {
@ -498,7 +498,7 @@ void screen_show_desktop(gboolean show)
dispatch_ob(Event_Ob_ShowDesktop, show, 0); dispatch_ob(Event_Ob_ShowDesktop, show, 0);
} }
void screen_install_colormap(Client *client, gboolean install) void screen_install_colormap(ObClient *client, gboolean install)
{ {
XWindowAttributes wa; XWindowAttributes wa;
@ -569,7 +569,7 @@ void screen_update_areas()
/* apply struts */ /* apply struts */
STRUT_SET(s, 0, 0, 0, 0); STRUT_SET(s, 0, 0, 0, 0);
for (it = client_list; it; it = it->next) for (it = client_list; it; it = it->next)
STRUT_ADD(s, ((Client*)it->data)->strut); STRUT_ADD(s, ((ObClient*)it->data)->strut);
STRUT_ADD(s, dock_strut); STRUT_ADD(s, dock_strut);
if (s.left) { if (s.left) {
@ -658,7 +658,7 @@ void screen_update_areas()
XXX if gunna test this shit, then gotta worry about when XXX if gunna test this shit, then gotta worry about when
the client moves between xinerama heads.. the client moves between xinerama heads..
if (RECT_CONTAINS_RECT(((Client*)it->data)->frame->area, if (RECT_CONTAINS_RECT(((ObClient*)it->data)->frame->area,
area[i][x])) { area[i][x])) {
} }
@ -671,7 +671,7 @@ void screen_update_areas()
/* the area has changed, adjust all the maximized /* the area has changed, adjust all the maximized
windows */ windows */
for (it = client_list; it; it = it->next) { for (it = client_list; it; it = it->next) {
Client *c = it->data; ObClient *c = it->data;
if (i < screen_num_desktops) { if (i < screen_num_desktops) {
if (c->desktop == i) if (c->desktop == i)
client_reconfigure(c); client_reconfigure(c);

View file

@ -5,7 +5,7 @@
#include "geom.h" #include "geom.h"
#include "client.h" #include "client.h"
struct Client; struct _ObClient;
#define DESKTOP_ALL (0xffffffff) #define DESKTOP_ALL (0xffffffff)
@ -57,7 +57,7 @@ void screen_update_desktop_names();
/*! Installs or uninstalls a colormap for a client. If client is NULL, then /*! Installs or uninstalls a colormap for a client. If client is NULL, then
it handles the root colormap. */ it handles the root colormap. */
void screen_install_colormap(struct Client *client, gboolean install); void screen_install_colormap(struct _ObClient *client, gboolean install);
void screen_update_areas(); void screen_update_areas();

View file

@ -133,7 +133,7 @@ static void do_lower(GList *wins)
} }
} }
static GList *pick_windows(Client *top, Client *selected, gboolean raise) static GList *pick_windows(ObClient *top, ObClient *selected, gboolean raise)
{ {
GList *ret = NULL; GList *ret = NULL;
GList *it, *next, *prev; GList *it, *next, *prev;
@ -154,7 +154,7 @@ static GList *pick_windows(Client *top, Client *selected, gboolean raise)
next = g_list_next(it); next = g_list_next(it);
if ((sit = g_slist_find(top->transients, it->data))) { if ((sit = g_slist_find(top->transients, it->data))) {
Client *c = sit->data; ObClient *c = sit->data;
++i; ++i;
@ -196,7 +196,7 @@ static GList *pick_windows(Client *top, Client *selected, gboolean raise)
return ret; return ret;
} }
static GList *pick_group_windows(Client *top, Client *selected, gboolean raise) static GList *pick_group_windows(ObClient *top, ObClient *selected, gboolean raise)
{ {
GList *ret = NULL; GList *ret = NULL;
GList *it, *next, *prev; GList *it, *next, *prev;
@ -229,8 +229,8 @@ void stacking_raise(ObWindow *window)
GList *wins; GList *wins;
if (WINDOW_IS_CLIENT(window)) { if (WINDOW_IS_CLIENT(window)) {
Client *c; ObClient *c;
Client *selected; ObClient *selected;
selected = WINDOW_AS_CLIENT(window); selected = WINDOW_AS_CLIENT(window);
c = client_search_top_transient(selected); c = client_search_top_transient(selected);
wins = pick_windows(c, selected, TRUE); wins = pick_windows(c, selected, TRUE);
@ -248,8 +248,8 @@ void stacking_lower(ObWindow *window)
GList *wins; GList *wins;
if (WINDOW_IS_CLIENT(window)) { if (WINDOW_IS_CLIENT(window)) {
Client *c; ObClient *c;
Client *selected; ObClient *selected;
selected = WINDOW_AS_CLIENT(window); selected = WINDOW_AS_CLIENT(window);
c = client_search_top_transient(selected); c = client_search_top_transient(selected);
wins = pick_windows(c, selected, FALSE); wins = pick_windows(c, selected, FALSE);
@ -279,8 +279,8 @@ void stacking_add(ObWindow *win)
void stacking_add_nonintrusive(ObWindow *win) void stacking_add_nonintrusive(ObWindow *win)
{ {
Client *client; ObClient *client;
Client *parent = NULL; ObClient *parent = NULL;
GList *it_before = NULL; GList *it_before = NULL;
if (!WINDOW_IS_CLIENT(win)) { if (!WINDOW_IS_CLIENT(win)) {
@ -303,7 +303,7 @@ void stacking_add_nonintrusive(ObWindow *win)
if ((sit = g_slist_find(client->group->members, it->data))) if ((sit = g_slist_find(client->group->members, it->data)))
for (sit = client->group->members; !parent && sit; for (sit = client->group->members; !parent && sit;
sit = sit->next) { sit = sit->next) {
Client *c = sit->data; ObClient *c = sit->data;
/* checking transient_for prevents infinate loops! */ /* checking transient_for prevents infinate loops! */
if (sit->data == it->data && !c->transient_for) if (sit->data == it->data && !c->transient_for)
parent = it->data; parent = it->data;

View file

@ -29,7 +29,7 @@ Window window_top(ObWindow *self)
g_assert_not_reached(); g_assert_not_reached();
break; break;
case Window_Client: case Window_Client:
return ((Client*)self)->frame->window; return ((ObClient*)self)->frame->window;
case Window_Internal: case Window_Internal:
return ((InternalWindow*)self)->win; return ((InternalWindow*)self)->win;
} }
@ -49,7 +49,7 @@ Window window_layer(ObWindow *self)
g_assert_not_reached(); g_assert_not_reached();
break; break;
case Window_Client: case Window_Client:
return ((Client*)self)->layer; return ((ObClient*)self)->layer;
case Window_Internal: case Window_Internal:
return Layer_Internal; return Layer_Internal;
} }

View file

@ -32,12 +32,12 @@ typedef struct InternalWindow {
struct Menu; struct Menu;
struct Dock; struct Dock;
struct DockApp; struct DockApp;
struct Client; struct _ObClient;
#define WINDOW_AS_MENU(win) ((struct Menu*)win) #define WINDOW_AS_MENU(win) ((struct Menu*)win)
#define WINDOW_AS_DOCK(win) ((struct Dock*)win) #define WINDOW_AS_DOCK(win) ((struct Dock*)win)
#define WINDOW_AS_DOCKAPP(win) ((struct DockApp*)win) #define WINDOW_AS_DOCKAPP(win) ((struct DockApp*)win)
#define WINDOW_AS_CLIENT(win) ((struct Client*)win) #define WINDOW_AS_CLIENT(win) ((struct _ObClient*)win)
#define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win) #define WINDOW_AS_INTERNAL(win) ((struct InternalWindow*)win)
#define MENU_AS_WINDOW(menu) ((ObWindow*)menu) #define MENU_AS_WINDOW(menu) ((ObWindow*)menu)

View file

@ -104,7 +104,7 @@ static void grab_keys(gboolean grab)
grab_for_window(focus_backup, grab); grab_for_window(focus_backup, grab);
for (it = client_list; it; it = g_list_next(it)) for (it = client_list; it; it = g_list_next(it))
grab_for_window(((Client*)it->data)->frame->window, grab); grab_for_window(((ObClient*)it->data)->frame->window, grab);
} }
static void reset_chains() static void reset_chains()

View file

@ -104,7 +104,7 @@ void plugin_setup_config()
/* Array of GSList*s of PointerBinding*s. */ /* Array of GSList*s of PointerBinding*s. */
static GSList *bound_contexts[NUM_CONTEXTS]; static GSList *bound_contexts[NUM_CONTEXTS];
static void grab_for_client(Client *client, gboolean grab) static void grab_for_client(ObClient *client, gboolean grab)
{ {
int i; int i;
GSList *it; GSList *it;
@ -167,7 +167,7 @@ static void clearall()
} }
} }
static void fire_button(MouseAction a, Context context, Client *c, guint state, static void fire_button(MouseAction a, Context context, ObClient *c, guint state,
guint button, int x, int y) guint button, int x, int y)
{ {
GSList *it; GSList *it;
@ -198,7 +198,7 @@ static void fire_button(MouseAction a, Context context, Client *c, guint state,
} }
} }
static void fire_motion(MouseAction a, Context context, Client *c, static void fire_motion(MouseAction a, Context context, ObClient *c,
guint state, guint button, int x_root, int y_root, guint state, guint button, int x_root, int y_root,
guint32 corner) guint32 corner)
{ {

View file

@ -49,7 +49,7 @@ static struct HistoryItem *history_find(const char *name, const char *class,
return NULL; return NULL;
} }
gboolean place_history(Client *c) gboolean place_history(ObClient *c)
{ {
struct HistoryItem *hi; struct HistoryItem *hi;
int x, y, w, h; int x, y, w, h;
@ -90,7 +90,7 @@ gboolean place_history(Client *c)
return FALSE; return FALSE;
} }
static void set_history(Client *c) static void set_history(ObClient *c)
{ {
struct HistoryItem *hi; struct HistoryItem *hi;

View file

@ -7,6 +7,6 @@
void history_startup(); void history_startup();
void history_shutdown(); void history_shutdown();
gboolean place_history(Client *c); gboolean place_history(ObClient *c);
#endif #endif

View file

@ -24,7 +24,7 @@ void plugin_setup_config()
parse_register("placement", parse_xml, NULL); parse_register("placement", parse_xml, NULL);
} }
static void place_random(Client *c) static void place_random(ObClient *c)
{ {
int l, r, t, b; int l, r, t, b;
int x, y; int x, y;

View file

@ -28,7 +28,7 @@ void plugin_setup_config()
parse_register("resistance", parse_xml, NULL); parse_register("resistance", parse_xml, NULL);
} }
static void resist_move(Client *c, int *x, int *y) static void resist_move(ObClient *c, int *x, int *y)
{ {
GList *it; GList *it;
Rect *area; Rect *area;
@ -37,7 +37,7 @@ static void resist_move(Client *c, int *x, int *y)
int al, at, ar, ab; /* screen area edges */ int al, at, ar, ab; /* screen area edges */
int cl, ct, cr, cb; /* current edges */ int cl, ct, cr, cb; /* current edges */
int w, h; /* current size */ int w, h; /* current size */
Client *snapx = NULL, *snapy = NULL; ObClient *snapx = NULL, *snapy = NULL;
w = c->frame->area.width; w = c->frame->area.width;
h = c->frame->area.height; h = c->frame->area.height;
@ -55,7 +55,7 @@ static void resist_move(Client *c, int *x, int *y)
/* snap to other clients */ /* snap to other clients */
if (resist_windows) if (resist_windows)
for (it = stacking_list; it != NULL; it = it->next) { for (it = stacking_list; it != NULL; it = it->next) {
Client *target; ObClient *target;
int tl, tt, tr, tb; /* 1 past the target's edges on each side */ int tl, tt, tr, tb; /* 1 past the target's edges on each side */
if (!WINDOW_IS_CLIENT(it->data)) if (!WINDOW_IS_CLIENT(it->data))
@ -131,16 +131,16 @@ static void resist_move(Client *c, int *x, int *y)
} }
} }
static void resist_size(Client *c, int *w, int *h, ObCorner corn) static void resist_size(ObClient *c, int *w, int *h, ObCorner corn)
{ {
GList *it; GList *it;
Client *target; /* target */ ObClient *target; /* target */
int l, t, r, b; /* my left, top, right and bottom sides */ int l, t, r, b; /* my left, top, right and bottom sides */
int dlt, drb; /* my destination left/top and right/bottom sides */ int dlt, drb; /* my destination left/top and right/bottom sides */
int tl, tt, tr, tb; /* target's left, top, right and bottom bottom sides */ int tl, tt, tr, tb; /* target's left, top, right and bottom bottom sides */
Rect *area; Rect *area;
int al, at, ar, ab; /* screen boundaries */ int al, at, ar, ab; /* screen boundaries */
Client *snapx = NULL, *snapy = NULL; ObClient *snapx = NULL, *snapy = NULL;
/* don't snap windows with size increments */ /* don't snap windows with size increments */
if (c->size_inc.width > 1 || c->size_inc.height > 1) if (c->size_inc.width > 1 || c->size_inc.height > 1)