all repos — openbox @ 2477a38d2f3063b697e44bf3690cf280fb26ca8a

openbox fork - make it a bit more like ryudo

rename the Client struct to ObClient
Dana Jansens danakj@orodu.net
commit

2477a38d2f3063b697e44bf3690cf280fb26ca8a

parent

375b504905908fb129f52b52ae7270deefda12f7

M openbox/action.copenbox/action.c

@@ -700,7 +700,7 @@ }

void action_move_relative_horz(union ActionData *data) { - Client *c = data->relative.c; + ObClient *c = data->relative.c; if (c) client_configure(c, OB_CORNER_TOPLEFT, c->area.x + data->relative.delta, c->area.y,

@@ -709,7 +709,7 @@ }

void action_move_relative_vert(union ActionData *data) { - Client *c = data->relative.c; + ObClient *c = data->relative.c; if (c) client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y + data->relative.delta,

@@ -718,7 +718,7 @@ }

void action_resize_relative_horz(union ActionData *data) { - Client *c = data->relative.c; + ObClient *c = data->relative.c; if (c) client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y, c->area.width +

@@ -728,7 +728,7 @@ }

void action_resize_relative_vert(union ActionData *data) { - Client *c = data->relative.c; + ObClient *c = data->relative.c; if (c && !c->shaded) client_configure(c, OB_CORNER_TOPLEFT, c->area.x, c->area.y, c->area.width, c->area.height +

@@ -1098,7 +1098,7 @@ }

void action_toggle_decorations(union ActionData *data) { - Client *c = data->client.c;; + ObClient *c = data->client.c;; if (!c) return;

@@ -1108,7 +1108,7 @@ }

void action_moveresize(union ActionData *data) { - Client *c = data->moveresize.c; + ObClient *c = data->moveresize.c; if (!c || !client_normal(c)) return;

@@ -1137,7 +1137,7 @@ }

void action_cycle_windows(union ActionData *data) { - Client *c; + ObClient *c; c = focus_cycle(data->cycle.forward, data->cycle.linear, data->cycle.final, data->cycle.cancel);

@@ -1145,7 +1145,7 @@ }

void action_directional_focus(union ActionData *data) { - Client *nf; + ObClient *nf; if (!data->diraction.c) return;

@@ -1157,7 +1157,7 @@

void action_movetoedge(union ActionData *data) { int x, y, h, w; - Client *c = data->diraction.c; + ObClient *c = data->diraction.c; if (!c) return;

@@ -1196,7 +1196,7 @@ }

void action_toggle_layer(union ActionData *data) { - Client *c = data->layer.c; + ObClient *c = data->layer.c; if (c) { if (data->layer.layer < 0)
M openbox/action.hopenbox/action.h

@@ -10,57 +10,57 @@ available (possibly NULL though) if it wants it.

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

@@ -68,14 +68,14 @@ guint button;

}; struct ShowMenu { - Client *c; + ObClient *c; char *name; int x; int y; }; struct CycleWindows { - Client *c; + ObClient *c; gboolean linear; gboolean forward; gboolean final;
M openbox/client.copenbox/client.c

@@ -30,18 +30,18 @@ ButtonMotionMask)

GList *client_list = NULL; -static void client_get_all(Client *self); -static void client_toggle_border(Client *self, gboolean show); -static void client_get_area(Client *self); -static void client_get_desktop(Client *self); -static void client_get_state(Client *self); -static void client_get_shaped(Client *self); -static void client_get_mwm_hints(Client *self); -static void client_get_gravity(Client *self); -static void client_showhide(Client *self); -static void client_change_allowed_actions(Client *self); -static void client_change_state(Client *self); -static void client_apply_startup_state(Client *self); +static void client_get_all(ObClient *self); +static void client_toggle_border(ObClient *self, gboolean show); +static void client_get_area(ObClient *self); +static void client_get_desktop(ObClient *self); +static void client_get_state(ObClient *self); +static void client_get_shaped(ObClient *self); +static void client_get_mwm_hints(ObClient *self); +static void client_get_gravity(ObClient *self); +static void client_showhide(ObClient *self); +static void client_change_allowed_actions(ObClient *self); +static void client_change_state(ObClient *self); +static void client_apply_startup_state(ObClient *self); void client_startup() {

@@ -63,7 +63,7 @@ if (size > 0) {

windows = g_new(Window, size); win_it = windows; for (it = client_list; it != NULL; it = it->next, ++win_it) - *win_it = ((Client*)it->data)->window; + *win_it = ((ObClient*)it->data)->window; } else windows = NULL;

@@ -76,7 +76,7 @@ stacking_set_list();

} /* -void client_foreach_transient(Client *self, ClientForeachFunc func, void *data) +void client_foreach_transient(ObClient *self, ObClientForeachFunc func, void *data) { GSList *it;

@@ -86,7 +86,7 @@ client_foreach_transient(it->data, func, 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 != TRAN_GROUP) {

@@ -97,7 +97,7 @@ GSList *it;

for (it = self->group->members; it; it = it->next) if (it->data != self && - !((Client*)it->data)->transient_for) { + !((ObClient*)it->data)->transient_for) { if (!func(it->data, data)) return; client_foreach_ancestor(it->data, func, data); }

@@ -176,7 +176,7 @@ }

void client_manage(Window window) { - Client *self; + ObClient *self; XEvent e; XWindowAttributes attrib; XSetWindowAttributes attrib_set;

@@ -223,9 +223,9 @@ XChangeWindowAttributes(ob_display, window,

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 */ - self = g_new(Client, 1); + self = g_new(ObClient, 1); self->obwin.type = Window_Client; self->window = window; client_get_all(self);

@@ -316,11 +316,11 @@

/* called by client_unmanage() to close any menus referencing this client */ 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); } -void client_unmanage(Client *self) +void client_unmanage(ObClient *self) { int j; GSList *it;

@@ -355,8 +355,8 @@ GSList *it;

for (it = self->group->members; it; it = it->next) if (it->data != self) - ((Client*)it->data)->transients = - g_slist_remove(((Client*)it->data)->transients, self); + ((ObClient*)it->data)->transients = + g_slist_remove(((ObClient*)it->data)->transients, self); } else if (self->transient_for) { /* transient of window */ self->transient_for->transients = g_slist_remove(self->transient_for->transients, self);

@@ -364,8 +364,8 @@ }

/* tell our transients that we're gone */ for (it = self->transients; it != NULL; it = it->next) { - if (((Client*)it->data)->transient_for != TRAN_GROUP) { - ((Client*)it->data)->transient_for = NULL; + if (((ObClient*)it->data)->transient_for != TRAN_GROUP) { + ((ObClient*)it->data)->transient_for = NULL; client_calc_layer(it->data); } }

@@ -435,7 +435,7 @@ /* update the list hints */

client_set_list(); } -void client_move_onscreen(Client *self) +void client_move_onscreen(ObClient *self) { Rect *a; int x = self->frame->area.x, y = self->frame->area.y;

@@ -458,7 +458,7 @@ self->area.width, self->area.height,

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 border is removed, the client should now be considered to be in a

@@ -524,7 +524,7 @@ XSetWindowBorderWidth(ob_display, self->window, 0);

} -static void client_get_all(Client *self) +static void client_get_all(ObClient *self) { /* update EVERYTHING!! */

@@ -574,7 +574,7 @@

client_change_state(self); } -static void client_get_area(Client *self) +static void client_get_area(ObClient *self) { XWindowAttributes wattrib; Status ret;

@@ -586,7 +586,7 @@ RECT_SET(self->area, wattrib.x, wattrib.y, wattrib.width, wattrib.height);

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 */

@@ -607,8 +607,8 @@ GSList *it;

for (it = self->group->members; it; it = it->next) if (it->data != self && - !((Client*)it->data)->transient_for) { - self->desktop = ((Client*)it->data)->desktop; + !((ObClient*)it->data)->transient_for) { + self->desktop = ((ObClient*)it->data)->desktop; trdesk = TRUE; break; }

@@ -625,7 +625,7 @@ PROP_SET32(self->window, net_wm_desktop, cardinal, self->desktop);

} } -static void client_get_state(Client *self) +static void client_get_state(ObClient *self) { guint32 *state; guint num;

@@ -663,7 +663,7 @@ g_free(state);

} } -static void client_get_shaped(Client *self) +static void client_get_shaped(ObClient *self) { self->shaped = FALSE; #ifdef SHAPE

@@ -682,10 +682,10 @@ }

#endif } -void client_update_transient_for(Client *self) +void client_update_transient_for(ObClient *self) { Window t = None; - Client *c = NULL; + ObClient *c = NULL; if (XGetTransientForHint(ob_display, self->window, &t)) { self->transient = TRUE;

@@ -717,9 +717,9 @@

/* remove from old parents */ for (it = self->group->members; it; it = it->next) if (it->data != self && - !((Client*)it->data)->transient_for) - ((Client*)it->data)->transients = - g_slist_remove(((Client*)it->data)->transients, self); + !((ObClient*)it->data)->transient_for) + ((ObClient*)it->data)->transients = + g_slist_remove(((ObClient*)it->data)->transients, self); } else if (self->transient_for != NULL) { /* transient of window */ /* remove from old parent */ self->transient_for->transients =

@@ -732,9 +732,9 @@

/* add to new parents */ for (it = self->group->members; it; it = it->next) if (it->data != self && - !((Client*)it->data)->transient_for) - ((Client*)it->data)->transients = - g_slist_append(((Client*)it->data)->transients, self); + !((ObClient*)it->data)->transient_for) + ((ObClient*)it->data)->transients = + g_slist_append(((ObClient*)it->data)->transients, self); /* remove all transients which are in the group, that causes circlular pointer hell of doom */

@@ -755,7 +755,7 @@ }

} } -static void client_get_mwm_hints(Client *self) +static void client_get_mwm_hints(ObClient *self) { guint num; guint32 *hints;

@@ -773,7 +773,7 @@ g_free(hints);

} } -void client_get_type(Client *self) +void client_get_type(ObClient *self) { guint num, i; guint32 *val;

@@ -824,7 +824,7 @@ self->type = Type_Normal;

} } -void client_update_protocols(Client *self) +void client_update_protocols(ObClient *self) { guint32 *proto; guint num_return, i;

@@ -846,7 +846,7 @@ g_free(proto);

} } -static void client_get_gravity(Client *self) +static void client_get_gravity(ObClient *self) { XWindowAttributes wattrib; Status ret;

@@ -856,7 +856,7 @@ g_assert(ret != BadWindow);

self->gravity = wattrib.win_gravity; } -void client_update_normal_hints(Client *self) +void client_update_normal_hints(ObClient *self) { XSizeHints size; long ret;

@@ -909,7 +909,7 @@ SIZE_SET(self->size_inc, size.width_inc, size.height_inc);

} } -void client_setup_decor_and_functions(Client *self) +void client_setup_decor_and_functions(ObClient *self) { /* start with everything (cept fullscreen) */ self->decorations = Decor_Titlebar | Decor_Handle | Decor_Border |

@@ -1040,7 +1040,7 @@ self->desktop = DESKTOP_ALL;

} } -static void client_change_allowed_actions(Client *self) +static void client_change_allowed_actions(ObClient *self) { guint32 actions[9]; int num = 0;

@@ -1090,7 +1090,7 @@ else self->max_vert = self->max_horz = FALSE;

} } -void client_reconfigure(Client *self) +void client_reconfigure(ObClient *self) { /* 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

@@ -1099,7 +1099,7 @@ client_configure(self, OB_CORNER_TOPLEFT, self->area.x, self->area.y,

self->area.width, self->area.height, FALSE, TRUE); } -void client_update_wmhints(Client *self) +void client_update_wmhints(ObClient *self) { XWMHints *hints; gboolean ur = FALSE;

@@ -1146,7 +1146,7 @@ /* add other transients of the group that are already

set up */ for (it = self->group->members; it; it = it->next) 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, it->data); }

@@ -1176,7 +1176,7 @@ dispatch_client(Event_Client_Urgent, self, self->urgent, 0);

} } -void client_update_title(Client *self) +void client_update_title(ObClient *self) { GList *it; guint32 nums;

@@ -1196,7 +1196,7 @@ /* look for duplicates and append a number */

nums = 0; for (it = client_list; it; it = it->next) if (it->data != self) { - Client *c = it->data; + ObClient *c = it->data; if (0 == strncmp(c->title, data, strlen(data))) nums |= 1 << c->title_count; }

@@ -1252,7 +1252,7 @@

self->icon_title = data; } -void client_update_class(Client *self) +void client_update_class(ObClient *self) { char **data; char *s;

@@ -1280,7 +1280,7 @@ if (self->class == NULL) self->class = g_strdup("");

if (self->role == NULL) self->role = g_strdup(""); } -void client_update_strut(Client *self) +void client_update_strut(ObClient *self) { guint num; guint32 *data;

@@ -1301,7 +1301,7 @@ if (self->frame)

screen_update_areas(); } -void client_update_icons(Client *self) +void client_update_icons(ObClient *self) { guint num; guint32 *data;

@@ -1325,7 +1325,7 @@ if (i > num || w*h == 0) break;

++self->nicons; } - self->icons = g_new(Icon, self->nicons); + self->icons = g_new(ObClientIcon, self->nicons); /* store the icons */ i = 0;

@@ -1357,7 +1357,7 @@ } else if (PROP_GETA32(self->window, kwm_win_icon,

kwm_win_icon, &data, &num)) { if (num == 2) { self->nicons++; - self->icons = g_new(Icon, self->nicons); + self->icons = g_new(ObClientIcon, self->nicons); xerror_set_ignore(TRUE); if (!RrPixmapToRGBA(ob_rr_inst, data[0], data[1],

@@ -1376,7 +1376,7 @@

if ((hints = XGetWMHints(ob_display, self->window))) { if (hints->flags & IconPixmapHint) { self->nicons++; - self->icons = g_new(Icon, self->nicons); + self->icons = g_new(ObClientIcon, self->nicons); xerror_set_ignore(TRUE); if (!RrPixmapToRGBA(ob_rr_inst, hints->icon_pixmap,

@@ -1398,7 +1398,7 @@ if (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 netstate[10];

@@ -1437,10 +1437,10 @@ if (self->frame)

frame_adjust_state(self->frame); } -Client *client_search_focus_tree(Client *self) +ObClient *client_search_focus_tree(ObClient *self) { GSList *it; - Client *ret; + ObClient *ret; for (it = self->transients; it != NULL; it = it->next) { if (client_focused(it->data)) return it->data;

@@ -1449,7 +1449,7 @@ }

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 != TRAN_GROUP) {

@@ -1459,8 +1459,8 @@ GSList *it;

gboolean recursed = FALSE; for (it = self->group->members; it; it = it->next) - if (!((Client*)it->data)->transient_for) { - Client *c; + if (!((ObClient*)it->data)->transient_for) { + ObClient *c; if ((c = client_search_focus_tree_full(it->data))) return c; recursed = TRUE;

@@ -1477,7 +1477,7 @@ return self;

return client_search_focus_tree(self); } -static StackLayer calc_layer(Client *self) +static StackLayer calc_layer(ObClient *self) { StackLayer l;

@@ -1494,7 +1494,7 @@

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 old, own;

@@ -1516,10 +1516,10 @@ stacking_add(CLIENT_AS_WINDOW(self));

} } -void client_calc_layer(Client *self) +void client_calc_layer(ObClient *self) { StackLayer l; - Client *orig; + ObClient *orig; orig = self;

@@ -1531,7 +1531,7 @@

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; else if (!(self->desktop == screen_desktop ||

@@ -1541,7 +1541,7 @@

return TRUE; } -static void client_showhide(Client *self) +static void client_showhide(ObClient *self) { if (client_should_show(self))

@@ -1550,12 +1550,12 @@ else

frame_hide(self->frame); } -gboolean client_normal(Client *self) { +gboolean client_normal(ObClient *self) { return ! (self->type == Type_Desktop || self->type == Type_Dock || 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.. */

@@ -1594,7 +1594,7 @@ below

*/ } -void client_configure(Client *self, ObCorner anchor, +void client_configure(ObClient *self, ObCorner anchor, int x, int y, int w, int h, gboolean user, gboolean final) {

@@ -1814,7 +1814,7 @@ }

} } -void client_fullscreen(Client *self, gboolean fs, gboolean savearea) +void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea) { int x, y, w, h;

@@ -1872,7 +1872,7 @@ /* try focus us when we go into fullscreen mode */

client_focus(self); } -static void client_iconify_recursive(Client *self, +static void client_iconify_recursive(ObClient *self, gboolean iconic, gboolean curdesk) { GSList *it;

@@ -1935,7 +1935,7 @@ if (it->data != self) client_iconify_recursive(it->data,

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 */ self = client_search_top_transient(self);

@@ -1944,7 +1944,7 @@ client_iconify_recursive(client_search_top_transient(self),

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;

@@ -2046,7 +2046,7 @@ frame_frame_gravity(self->frame, &x, &y);

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 */ self->shaded == shade) return; /* already done */

@@ -2060,7 +2060,7 @@ /* resize the frame to just the titlebar */

frame_adjust_area(self->frame, FALSE, FALSE); } -void client_close(Client *self) +void client_close(ObClient *self) { XEvent ce;

@@ -2087,12 +2087,12 @@ ce.xclient.data.l[4] = 0l;

XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce); } -void client_kill(Client *self) +void client_kill(ObClient *self) { XKillClient(ob_display, self->window); } -void client_set_desktop_recursive(Client *self, +void client_set_desktop_recursive(ObClient *self, guint target, gboolean donthide) { guint old;

@@ -2135,26 +2135,26 @@ if (it->data != self) client_set_desktop_recursive(it->data,

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), target, donthide); } -Client *client_search_modal_child(Client *self) +ObClient *client_search_modal_child(ObClient *self) { GSList *it; - Client *ret; + ObClient *ret; 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 (c->modal) return c; } return NULL; } -gboolean client_validate(Client *self) +gboolean client_validate(ObClient *self) { XEvent e;

@@ -2169,7 +2169,7 @@

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 */

@@ -2183,7 +2183,7 @@ break;

} } -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 fullscreen = self->fullscreen;

@@ -2307,9 +2307,9 @@ client_calc_layer(self);

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 */ child = client_search_modal_child(self);

@@ -2317,7 +2317,7 @@ if (child) return child;

return self; } -gboolean client_can_focus(Client *self) +gboolean client_can_focus(ObClient *self) { XEvent ev;

@@ -2354,7 +2354,7 @@

return TRUE; } -gboolean client_focus(Client *self) +gboolean client_focus(ObClient *self) { /* choose the correct target */ self = client_focus_target(self);

@@ -2402,7 +2402,7 @@ XSync(ob_display, FALSE);

return TRUE; } -void client_unfocus(Client *self) +void client_unfocus(ObClient *self) { g_assert(focus_client == self); #ifdef DEBUG_FOCUS

@@ -2411,7 +2411,7 @@ #endif

focus_fallback(Fallback_Unfocusing); } -void client_activate(Client *self) +void client_activate(ObClient *self) { if (client_normal(self) && screen_showing_desktop) screen_show_desktop(FALSE);

@@ -2427,12 +2427,12 @@ client_focus(self);

stacking_raise(CLIENT_AS_WINDOW(self)); } -gboolean client_focused(Client *self) +gboolean client_focused(ObClient *self) { return self == focus_client; } -Icon *client_icon(Client *self, int w, int h) +ObClientIcon *client_icon(ObClient *self, int w, int h) { int i; /* si is the smallest image >= req */

@@ -2458,13 +2458,13 @@ return &self->icons[li];

} /* 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 offset = 0; int distance = 0; int score, best_score; - Client *best_client, *cur; + ObClient *best_client, *cur; GList *it; if(!client_list)

@@ -2554,7 +2554,7 @@

return best_client; } -void client_set_layer(Client *self, int layer) +void client_set_layer(ObClient *self, int layer) { if (layer < 0) { self->below = TRUE;

@@ -2569,7 +2569,7 @@ client_calc_layer(self);

client_change_state(self); /* reflect this in the state hints */ } -guint client_monitor(Client *self) +guint client_monitor(ObClient *self) { guint i;

@@ -2583,7 +2583,7 @@ g_assert(i < screen_num_monitors);

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 */ if (self->transient_for) {

@@ -2593,7 +2593,7 @@ } else {

GSList *it; for (it = self->group->members; it; it = it->next) { - Client *c = it->data; + ObClient *c = it->data; /* checking transient_for prevents infinate loops! */ if (c != self && !c->transient_for)
M openbox/client.hopenbox/client.h

@@ -13,15 +13,20 @@

struct Frame; struct Group; +typedef struct _ObClient ObClient; +typedef struct _ObClientIcon ObClientIcon; + /* The value in client.transient_for indicating it is a transient for its group instead of for a single window */ #define TRAN_GROUP ((void*)~0l) /*! Holds an icon in ARGB format */ -typedef struct Icon { - int width, height; +struct _ObClientIcon +{ + gint width; + gint height; RrPixel32 *data; -} Icon; +}; /*! Possible window types */ typedef enum {

@@ -61,7 +66,8 @@ Decor_Shade = 1 << 7, /*!< Displays a shade button */

Decor_Close = 1 << 8 /*!< Display a close button */ } Decoration; -typedef struct Client { +struct _ObClient +{ ObWindow obwin; Window window;

@@ -83,7 +89,7 @@ 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 case. */ - struct Client *transient_for; + ObClient *transient_for; /*! The clients which are transients (children) of this client */ GSList *transients; /*! The desktop on which the window resides (0xffffffff for all

@@ -235,10 +241,10 @@ */

int functions; /*! Icons for the client as specified on the client window */ - Icon *icons; + ObClientIcon *icons; /*! The number of icons in icons */ int nicons; -} Client; +}; extern GList *client_list;

@@ -252,7 +258,7 @@ void client_manage(Window win);

/*! Unmanages all managed windows */ void client_unmanage_all(); /*! 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 */ void client_set_list();

@@ -260,15 +266,15 @@

/*! Determines if the client should be shown or hidden currently. @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. Some windows (desktops, docks, splash screens) have special rules applied 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 */ -gboolean client_focused(Client *self); +gboolean client_focused(ObClient *self); /*! Move and/or resize the window. This also maintains things like the client's minsize, and size increments.

@@ -285,16 +291,16 @@ configuration. e.g. Final should be FALSE if doing an

interactive move/resize, and then be TRUE for the last call only. */ -void client_configure(Client *self, ObCorner anchor, +void client_configure(ObClient *self, ObCorner anchor, int x, int y, int w, int h, 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 viewable screen. */ -void client_move_onscreen(Client *self); +void client_move_onscreen(ObClient *self); /*! Fullscreen's or unfullscreen's the client window @param fs true if the window should be made fullscreen; false if it should

@@ -304,7 +310,7 @@ otherwise, they are not. You should not save when mapping a

new window that is set to fullscreen. This has no effect 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 @param iconic true if the window should be iconified; false if it should be

@@ -313,7 +319,7 @@ @param curdesk If iconic is FALSE, then this determines if the window will

be uniconified to the current viewable desktop (true) or to 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 @param max true if the window should be maximized; false if it should be

@@ -324,35 +330,35 @@ otherwise, they are not. You should not save when mapping a

new window that is set to fullscreen. This has no effect when unmaximizing a window. */ -void client_maximize(Client *self, gboolean max, int dir, +void client_maximize(ObClient *self, gboolean max, int dir, gboolean savearea); /*! Shades or unshades the client window @param shade true if the window should be shaded; false if it should be unshaded. */ -void client_shade(Client *self, gboolean shade); +void client_shade(ObClient *self, gboolean shade); /*! Request the client to close its window */ -void client_close(Client *self); +void client_close(ObClient *self); /*! Kill the client off violently */ -void client_kill(Client *self); +void client_kill(ObClient *self); /*! Sends the window to the specified desktop @param donthide If TRUE, the window will not be shown/hidden after its 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 the event queue for the window. @return true if the client is valid; false if the client has already 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 */ -void client_set_wm_state(Client *self, long state); +void client_set_wm_state(ObClient *self, long state); /*! Adjusts the window's net_state This should not be called as part of the window mapping process! It is for

@@ -360,94 +366,94 @@ use when updating the state post-mapping.<br>

client_apply_startup_state is used to do the same things during the mapping 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 - you wanted to give focus to the specified Client. Will return the same - Client passed to it or another Client if appropriate. */ -Client *client_focus_target(Client *self); +/* Given a ObClient, find the client that focus would actually be sent to if + you wanted to give focus to the specified ObClient. Will return the same + ObClient passed to it or another ObClient if appropriate. */ +ObClient *client_focus_target(ObClient *self); /*! Returns what client_focus would return if passed the same client, but 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 */ -gboolean client_focus(Client *self); +gboolean client_focus(ObClient *self); /*! 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 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 */ -void client_calc_layer(Client *self); +void client_calc_layer(ObClient *self); /*! 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 change */ -void client_update_protocols(Client *self); +void client_update_protocols(ObClient *self); /*! 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 @param initstate Whether to read the initial_state property from the WMHints. This should only be used during the mapping process. */ -void client_update_wmhints(Client *self); +void client_update_wmhints(ObClient *self); /*! 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 */ -void client_update_class(Client *self); +void client_update_class(ObClient *self); /*! Updates the strut for the client */ -void client_update_strut(Client *self); +void client_update_strut(ObClient *self); /*! 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 - be allowed (Client::decorations and Client::functions). + be allowed (ObClient::decorations and ObClient::functions). 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 */ -void client_get_type(Client *self); +/*! Retrieves the window's type and sets ObClient->type */ +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 check for the passed client, only for its transients. 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 up the tree and down other branches as well as the passed client's. 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, or 0 if 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 */ -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. @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 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
M openbox/dispatch.copenbox/dispatch.c

@@ -84,7 +84,7 @@ }

} } -void dispatch_x(XEvent *xe, Client *c) +void dispatch_x(XEvent *xe, ObClient *c) { EventType e; guint i;

@@ -141,7 +141,7 @@ f->h(&obe, f->data);

} } -void dispatch_client(EventType e, Client *c, int num0, int num1) +void dispatch_client(EventType e, ObClient *c, int num0, int num1) { guint i; GSList *it;

@@ -211,7 +211,7 @@ f->h(&obe, f->data);

} } -void dispatch_move(Client *c, int *x, int *y) +void dispatch_move(ObClient *c, int *x, int *y) { guint i; GSList *it;

@@ -238,7 +238,7 @@ *x = obe.data.c.num[0];

*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; GSList *it;
M openbox/dispatch.hopenbox/dispatch.h

@@ -41,23 +41,23 @@ } EventType;

typedef struct { XEvent *e; - Client *client; + ObClient *client; } EventData_X; typedef struct { - Client *client; + ObClient *client; int num[3]; - /* Event_Client_Desktop: num[0] = new number, num[1] = old number - Event_Client_Urgent: num[0] = urgent state - Event_Client_Moving: num[0] = dest x coord, num[1] = dest y coord -- + /* Event_ObClient_Desktop: num[0] = new number, num[1] = old number + Event_ObClient_Urgent: num[0] = urgent state + Event_ObClient_Moving: num[0] = dest x coord, num[1] = dest y coord -- change these in the handler to adjust where the 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 window will be placed num[2] = the anchored corner */ -} EventData_Client; +} EventData_ObClient; typedef struct { int num[2];

@@ -73,7 +73,7 @@ } EventData_Signal;

typedef struct { 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_Signal s; /* for Event_Signal */ } EventData;

@@ -89,15 +89,15 @@ typedef unsigned int EventMask;

void dispatch_register(EventMask mask, EventHandler h, void *data); -void dispatch_x(XEvent *e, Client *c); -void dispatch_client(EventType e, Client *c, int num0, int num1); +void dispatch_x(XEvent *e, ObClient *c); +void dispatch_client(EventType e, ObClient *c, int num0, int num1); void dispatch_ob(EventType e, int num0, int num1); void dispatch_signal(int signal); /* *x and *y should be set with the destination of the window, they may be 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 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
M openbox/event.copenbox/event.c

@@ -40,8 +40,8 @@ static void event_process(XEvent *e);

static void event_handle_root(XEvent *e); static void event_handle_dock(Dock *s, XEvent *e); static void event_handle_dockapp(DockApp *app, XEvent *e); -static void event_handle_client(Client *c, XEvent *e); -static void event_handle_menu(Client *c, XEvent *e); +static void event_handle_client(ObClient *c, XEvent *e); +static void event_handle_menu(ObClient *c, XEvent *e); static void fd_event_handle(); #ifdef USE_SM static void ice_watch(IceConn conn, IcePointer data, Bool opening,

@@ -320,7 +320,7 @@ break;

} } -static gboolean event_ignore(XEvent *e, Client *client) +static gboolean event_ignore(XEvent *e, ObClient *client) { switch(e->type) { case FocusIn:

@@ -467,7 +467,7 @@

static void event_process(XEvent *e) { Window window; - Client *client = NULL; + ObClient *client = NULL; Dock *dock = NULL; DockApp *dockapp = NULL; Menu *menu = NULL;

@@ -607,7 +607,7 @@ #endif

} } -static void event_handle_client(Client *client, XEvent *e) +static void event_handle_client(ObClient *client, XEvent *e) { XEvent ce; Atom msgtype;

@@ -982,7 +982,7 @@ #endif

} } -static void event_handle_menu(Client *client, XEvent *e) +static void event_handle_menu(ObClient *client, XEvent *e) { static MenuEntry *over = NULL; MenuEntry *entry;
M openbox/focus.copenbox/focus.c

@@ -17,13 +17,13 @@ #include <X11/Xlib.h>

#include <glib.h> #include <assert.h> -Client *focus_client = NULL; +ObClient *focus_client = NULL; GList **focus_order = NULL; /* these lists are created when screen_startup sets the number of desktops */ Window focus_backup = None; -static Client *focus_cycle_target = NULL; +static ObClient *focus_cycle_target = NULL; static Popup *focus_cycle_popup = NULL; void focus_startup()

@@ -69,7 +69,7 @@ XSetInputFocus(ob_display, PointerRoot, RevertToPointerRoot,

event_lasttime); } -static void push_to_top(Client *client) +static void push_to_top(ObClient *client) { guint desktop;

@@ -79,10 +79,10 @@ focus_order[desktop] = g_list_remove(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; - Client *old; + ObClient *old; #ifdef DEBUG_FOCUS g_message("focus_set_client 0x%lx", client ? client->window : 0);

@@ -130,7 +130,7 @@

if (ob_pointer_pos(&x, &y)) { for (it = stacking_list; it != NULL; it = it->next) { 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 && RECT_CONTAINS(c->frame->area, x, y)) break;

@@ -146,10 +146,10 @@ }

/* finds the first transient that isn't 'skip' and ensure's that client_normal 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; - Client *ret; + ObClient *ret; for (it = c->transients; it; it = it->next) { if (it->data == top) return NULL;

@@ -160,9 +160,9 @@ }

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) { /* make sure client_normal is true always */ if (!client_normal(top))

@@ -175,7 +175,7 @@

void focus_fallback(FallbackType type) { GList *it; - Client *old = NULL; + ObClient *old = NULL; old = focus_client;

@@ -231,7 +231,7 @@ if (client_normal(it->data) &&

/* dont fall back to 'anonymous' fullscreen windows. theres no checks for this is in transient/group fallbacks, so they can be fallback targets there. */ - !((Client*)it->data)->fullscreen && + !((ObClient*)it->data)->fullscreen && client_can_focus(it->data)) { gboolean r = client_focus(it->data); assert(r);

@@ -241,13 +241,13 @@

/* 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) { popup_hide(focus_cycle_popup); } else { Rect *a; - Client *p = c; + ObClient *p = c; char *title; a = screen_physical_area_monitor(0);

@@ -280,14 +280,14 @@ g_free(title);

} } -Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, +ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done, gboolean cancel) { - static Client *first = NULL; - static Client *t = NULL; + static ObClient *first = NULL; + static ObClient *t = NULL; static GList *order = NULL; GList *it, *start, *list; - Client *ft; + ObClient *ft; if (cancel) { if (focus_cycle_target)

@@ -355,7 +355,7 @@

return NULL; } -void focus_order_add_new(Client *c) +void focus_order_add_new(ObClient *c) { guint d, i;

@@ -365,20 +365,20 @@ else {

d = c->desktop; if (d == DESKTOP_ALL) { 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); else focus_order[i] = g_list_insert(focus_order[i], c, 1); } } 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); else 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;

@@ -390,7 +390,7 @@ } else

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); if (!c->iconic) {

@@ -400,12 +400,12 @@ GList *it;

/* insert before first iconic window */ 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); } } -void focus_order_to_top(Client *c) +void focus_order_to_top(ObClient *c) { guint d, i;

@@ -417,7 +417,7 @@ } else

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); if (c->iconic) {

@@ -427,12 +427,12 @@ GList *it;

/* insert before first iconic window */ 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); } } -void focus_order_to_bottom(Client *c) +void focus_order_to_bottom(ObClient *c) { guint d, i;
M openbox/focus.hopenbox/focus.h

@@ -4,13 +4,13 @@

#include <X11/Xlib.h> #include <glib.h> -struct Client; +struct _ObClient; /*! The window which gets focus when nothing else will be focused */ extern Window focus_backup; /*! The client which is currently focused */ -extern struct Client *focus_client; +extern struct _ObClient *focus_client; /*! The recent focus order on each desktop */ extern GList **focus_order;

@@ -20,7 +20,7 @@ void focus_shutdown();

/*! Specify which client is currently focused, this doesn't actually 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 { Fallback_Desktop, /* switching desktops */

@@ -32,21 +32,21 @@ /*! Call this when you need to focus something! */

void focus_fallback(FallbackType type); /*! Cycle focus amongst windows - Returns the Client to which focus has been cycled, or NULL if none. */ -struct Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, + Returns the _ObClient to which focus has been cycled, or NULL if none. */ +struct _ObClient *focus_cycle(gboolean forward, gboolean linear, gboolean done, gboolean cancel); /*! 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 */ -void focus_order_remove(struct Client *c); +void focus_order_remove(struct _ObClient *c); /*! 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 very bottom always though). */ -void focus_order_to_bottom(struct Client *c); +void focus_order_to_bottom(struct _ObClient *c); #endif
M openbox/frame.copenbox/frame.c

@@ -330,7 +330,7 @@ {

framerender_frame(self); } -void frame_grab_client(Frame *self, Client *client) +void frame_grab_client(Frame *self, ObClient *client) { self->client = client;

@@ -372,7 +372,7 @@ g_hash_table_insert(window_map, &self->lgrip, 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;

@@ -578,7 +578,7 @@ return Context_Close;

return Context_None; } -Context frame_context(Client *client, Window win) +Context frame_context(ObClient *client, Window win) { Frame *self;
M openbox/frame.hopenbox/frame.h

@@ -29,7 +29,7 @@ #define FRAME_HANDLE_Y(f) (f->innersize.top + f->client->area.height + \

f->cbwidth) typedef struct Frame { - Client *client; + ObClient *client; Window window; Window plate;

@@ -96,12 +96,12 @@ void frame_adjust_state(Frame *self);

void frame_adjust_focus(Frame *self, gboolean hilite); void frame_adjust_title(Frame *self); void frame_adjust_icon(Frame *self); -void frame_grab_client(Frame *self, Client *client); -void frame_release_client(Frame *self, Client *client); +void frame_grab_client(Frame *self, ObClient *client); +void frame_release_client(Frame *self, ObClient *client); 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 be positioned.
M openbox/framerender.copenbox/framerender.c

@@ -158,9 +158,9 @@ {

if (self->icon_x < 0) return; if (self->client->nicons) { - Icon *icon = client_icon(self->client, - ob_rr_theme->button_size + 2, - ob_rr_theme->button_size + 2); + ObClientIcon *icon = client_icon(self->client, + ob_rr_theme->button_size + 2, + ob_rr_theme->button_size + 2); a->texture[0].type = RR_TEXTURE_RGBA; a->texture[0].data.rgba.width = icon->width; a->texture[0].data.rgba.height = icon->height;
M openbox/group.copenbox/group.c

@@ -17,7 +17,7 @@ {

g_hash_table_destroy(group_map); } -Group *group_add(Window leader, Client *client) +Group *group_add(Window leader, ObClient *client) { Group *self;

@@ -34,7 +34,7 @@

return self; } -void group_remove(Group *self, Client *client) +void group_remove(Group *self, ObClient *client) { self->members = g_slist_remove(self->members, client); if (self->members == NULL) {
M openbox/group.hopenbox/group.h

@@ -4,7 +4,7 @@

#include <X11/Xlib.h> #include <glib.h> -struct Client; +struct _ObClient; typedef struct Group { Window leader;

@@ -18,8 +18,8 @@

void group_startup(); 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
M openbox/menu.copenbox/menu.c

@@ -61,7 +61,7 @@ g_free(id);

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) {

@@ -288,7 +288,7 @@

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;

@@ -302,7 +302,7 @@

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);

@@ -397,7 +397,7 @@ /*

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; Rect *a = NULL;
M openbox/menu.hopenbox/menu.h

@@ -10,7 +10,8 @@

struct Menu; 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_mouseover)(struct MenuEntry *self, gboolean enter);

@@ -44,7 +45,7 @@ void (*selected)( /* some bummu */);

/* render stuff */ - Client *client; + ObClient *client; Window frame; Window 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); void menu_free(char *name); -void menu_show(char *name, int x, int y, Client *client); -void menu_show_full(Menu *menu, 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, ObClient *client); void menu_hide(Menu *self);
M openbox/moveresize.copenbox/moveresize.c

@@ -14,7 +14,7 @@ #include <X11/Xlib.h>

#include <glib.h> gboolean moveresize_in_progress = FALSE; -Client *moveresize_client = NULL; +ObClient *moveresize_client = NULL; static gboolean moving = FALSE; /* TRUE - moving, FALSE - resizing */

@@ -79,7 +79,7 @@ popup_show(popup, text, NULL);

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; Rect *a;
M openbox/moveresize.hopenbox/moveresize.h

@@ -6,12 +6,12 @@

#include <glib.h> extern gboolean moveresize_in_progress; -extern Client *moveresize_client; +extern ObClient *moveresize_client; void moveresize_startup(); 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_event(XEvent *e);
M openbox/popup.copenbox/popup.c

@@ -105,7 +105,7 @@ iconw = (self->hasicon ? texth : 0);

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 textw, texth;
M openbox/popup.hopenbox/popup.h

@@ -19,7 +19,7 @@ the text size. */

void popup_size(Popup *self, int w, int h); 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); #endif
M openbox/screen.copenbox/screen.c

@@ -292,7 +292,7 @@ focus_order[i] = NULL;

/* move windows on desktops that will no longer exist! */ 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) client_set_desktop(c, num - 1, FALSE); }

@@ -328,7 +328,7 @@

/* show windows from top to bottom */ for (it = stacking_list; it != NULL; it = it->next) { if (WINDOW_IS_CLIENT(it->data)) { - Client *c = it->data; + ObClient *c = it->data; if (!c->frame->visible && client_should_show(c)) frame_show(c->frame); }

@@ -337,7 +337,7 @@

/* hide windows from bottom to top */ for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { if (WINDOW_IS_CLIENT(it->data)) { - Client *c = it->data; + ObClient *c = it->data; if (c->frame->visible && !client_should_show(c)) frame_hide(c->frame); }

@@ -466,7 +466,7 @@ if (show) {

/* bottom to top */ for (it = g_list_last(stacking_list); it != NULL; it = it->prev) { if (WINDOW_IS_CLIENT(it->data)) { - Client *client = it->data; + ObClient *client = it->data; if (client->frame->visible && !client_should_show(client)) frame_hide(client->frame); }

@@ -475,7 +475,7 @@ } else {

/* top to bottom */ for (it = stacking_list; it != NULL; it = it->next) { if (WINDOW_IS_CLIENT(it->data)) { - Client *client = it->data; + ObClient *client = it->data; if (!client->frame->visible && client_should_show(client)) frame_show(client->frame); }

@@ -485,7 +485,7 @@

if (show) { /* focus desktop */ 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)) break; } else {

@@ -498,7 +498,7 @@

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;

@@ -569,7 +569,7 @@

/* apply struts */ STRUT_SET(s, 0, 0, 0, 0); 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); if (s.left) {

@@ -658,7 +658,7 @@

XXX if gunna test this shit, then gotta worry about when 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])) { }

@@ -671,7 +671,7 @@

/* the area has changed, adjust all the maximized windows */ for (it = client_list; it; it = it->next) { - Client *c = it->data; + ObClient *c = it->data; if (i < screen_num_desktops) { if (c->desktop == i) client_reconfigure(c);
M openbox/screen.hopenbox/screen.h

@@ -5,7 +5,7 @@ #include "misc.h"

#include "geom.h" #include "client.h" -struct Client; +struct _ObClient; #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 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();
M openbox/stacking.copenbox/stacking.c

@@ -133,7 +133,7 @@ }

} } -static GList *pick_windows(Client *top, Client *selected, gboolean raise) +static GList *pick_windows(ObClient *top, ObClient *selected, gboolean raise) { GList *ret = NULL; GList *it, *next, *prev;

@@ -154,7 +154,7 @@ prev = g_list_previous(it);

next = g_list_next(it); if ((sit = g_slist_find(top->transients, it->data))) { - Client *c = sit->data; + ObClient *c = sit->data; ++i;

@@ -196,7 +196,7 @@

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 *it, *next, *prev;

@@ -229,8 +229,8 @@ {

GList *wins; if (WINDOW_IS_CLIENT(window)) { - Client *c; - Client *selected; + ObClient *c; + ObClient *selected; selected = WINDOW_AS_CLIENT(window); c = client_search_top_transient(selected); wins = pick_windows(c, selected, TRUE);

@@ -248,8 +248,8 @@ {

GList *wins; if (WINDOW_IS_CLIENT(window)) { - Client *c; - Client *selected; + ObClient *c; + ObClient *selected; selected = WINDOW_AS_CLIENT(window); c = client_search_top_transient(selected); wins = pick_windows(c, selected, FALSE);

@@ -279,8 +279,8 @@ }

void stacking_add_nonintrusive(ObWindow *win) { - Client *client; - Client *parent = NULL; + ObClient *client; + ObClient *parent = NULL; GList *it_before = NULL; if (!WINDOW_IS_CLIENT(win)) {

@@ -303,7 +303,7 @@ for (it = stacking_list; !parent && it; it = it->next) {

if ((sit = g_slist_find(client->group->members, it->data))) for (sit = client->group->members; !parent && sit; sit = sit->next) { - Client *c = sit->data; + ObClient *c = sit->data; /* checking transient_for prevents infinate loops! */ if (sit->data == it->data && !c->transient_for) parent = it->data;
M openbox/window.copenbox/window.c

@@ -29,7 +29,7 @@ /* not to be used for stacking */

g_assert_not_reached(); break; case Window_Client: - return ((Client*)self)->frame->window; + return ((ObClient*)self)->frame->window; case Window_Internal: return ((InternalWindow*)self)->win; }

@@ -49,7 +49,7 @@ /* not to be used for stacking */

g_assert_not_reached(); break; case Window_Client: - return ((Client*)self)->layer; + return ((ObClient*)self)->layer; case Window_Internal: return Layer_Internal; }
M openbox/window.hopenbox/window.h

@@ -32,12 +32,12 @@

struct Menu; struct Dock; struct DockApp; -struct Client; +struct _ObClient; #define WINDOW_AS_MENU(win) ((struct Menu*)win) #define WINDOW_AS_DOCK(win) ((struct Dock*)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 MENU_AS_WINDOW(menu) ((ObWindow*)menu)
M plugins/keyboard/keyboard.cplugins/keyboard/keyboard.c

@@ -104,7 +104,7 @@ GList *it;

grab_for_window(focus_backup, grab); 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()
M plugins/mouse/mouse.cplugins/mouse/mouse.c

@@ -104,7 +104,7 @@

/* Array of GSList*s of PointerBinding*s. */ 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; GSList *it;

@@ -167,7 +167,7 @@ g_slist_free(bound_contexts[i]);

} } -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) { GSList *it;

@@ -198,7 +198,7 @@ }

} } -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, guint32 corner) {
M plugins/placement/history.cplugins/placement/history.c

@@ -49,7 +49,7 @@ }

return NULL; } -gboolean place_history(Client *c) +gboolean place_history(ObClient *c) { struct HistoryItem *hi; int x, y, w, h;

@@ -90,7 +90,7 @@

return FALSE; } -static void set_history(Client *c) +static void set_history(ObClient *c) { struct HistoryItem *hi;
M plugins/placement/history.hplugins/placement/history.h

@@ -7,6 +7,6 @@

void history_startup(); void history_shutdown(); -gboolean place_history(Client *c); +gboolean place_history(ObClient *c); #endif
M plugins/placement/placement.cplugins/placement/placement.c

@@ -24,7 +24,7 @@

parse_register("placement", parse_xml, NULL); } -static void place_random(Client *c) +static void place_random(ObClient *c) { int l, r, t, b; int x, y;
M plugins/resistance/resistance.cplugins/resistance/resistance.c

@@ -28,7 +28,7 @@

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; Rect *area;

@@ -37,7 +37,7 @@ int l, t, r, b; /* requested edges */

int al, at, ar, ab; /* screen area edges */ int cl, ct, cr, cb; /* current edges */ int w, h; /* current size */ - Client *snapx = NULL, *snapy = NULL; + ObClient *snapx = NULL, *snapy = NULL; w = c->frame->area.width; h = c->frame->area.height;

@@ -55,7 +55,7 @@

/* snap to other clients */ if (resist_windows) 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 */ if (!WINDOW_IS_CLIENT(it->data))

@@ -131,16 +131,16 @@ *y = ab - h + 1;

} } -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; - Client *target; /* target */ + ObClient *target; /* target */ int l, t, r, b; /* my left, top, right and 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 */ Rect *area; int al, at, ar, ab; /* screen boundaries */ - Client *snapx = NULL, *snapy = NULL; + ObClient *snapx = NULL, *snapy = NULL; /* don't snap windows with size increments */ if (c->size_inc.width > 1 || c->size_inc.height > 1)