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,
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,
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 +
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 +
void action_toggle_decorations(union ActionData *data)
{
- Client *c = data->client.c;;
+ ObClient *c = data->client.c;;
if (!c) return;
void action_moveresize(union ActionData *data)
{
- Client *c = data->moveresize.c;
+ ObClient *c = data->moveresize.c;
if (!c || !client_normal(c)) return;
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);
void action_directional_focus(union ActionData *data)
{
- Client *nf;
+ ObClient *nf;
if (!data->diraction.c)
return;
void action_movetoedge(union ActionData *data)
{
int x, y, h, w;
- Client *c = data->diraction.c;
+ ObClient *c = data->diraction.c;
if (!c)
return;
void action_toggle_layer(union ActionData *data)
{
- Client *c = data->layer.c;
+ ObClient *c = data->layer.c;
if (c) {
if (data->layer.layer < 0)
*/
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_* */
};
struct ShowMenu {
- Client *c;
+ ObClient *c;
char *name;
int x;
int y;
};
struct CycleWindows {
- Client *c;
+ ObClient *c;
gboolean linear;
gboolean forward;
gboolean final;
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()
{
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;
}
/*
-void client_foreach_transient(Client *self, ClientForeachFunc func, void *data)
+void client_foreach_transient(ObClient *self, ObClientForeachFunc func, void *data)
{
GSList *it;
}
}
-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) {
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);
}
void client_manage(Window window)
{
- Client *self;
+ ObClient *self;
XEvent e;
XWindowAttributes attrib;
XSetWindowAttributes 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 */
- self = g_new(Client, 1);
+ self = g_new(ObClient, 1);
self->obwin.type = Window_Client;
self->window = window;
client_get_all(self);
/* 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;
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);
/* 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);
}
}
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;
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
}
-static void client_get_all(Client *self)
+static void client_get_all(ObClient *self)
{
/* update EVERYTHING!! */
client_change_state(self);
}
-static void client_get_area(Client *self)
+static void client_get_area(ObClient *self)
{
XWindowAttributes wattrib;
Status ret;
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 */
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;
}
}
}
-static void client_get_state(Client *self)
+static void client_get_state(ObClient *self)
{
guint32 *state;
guint num;
}
}
-static void client_get_shaped(Client *self)
+static void client_get_shaped(ObClient *self)
{
self->shaped = FALSE;
#ifdef SHAPE
#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;
/* 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 =
/* 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 */
}
}
-static void client_get_mwm_hints(Client *self)
+static void client_get_mwm_hints(ObClient *self)
{
guint num;
guint32 *hints;
}
}
-void client_get_type(Client *self)
+void client_get_type(ObClient *self)
{
guint num, i;
guint32 *val;
}
}
-void client_update_protocols(Client *self)
+void client_update_protocols(ObClient *self)
{
guint32 *proto;
guint num_return, i;
}
}
-static void client_get_gravity(Client *self)
+static void client_get_gravity(ObClient *self)
{
XWindowAttributes wattrib;
Status ret;
self->gravity = wattrib.win_gravity;
}
-void client_update_normal_hints(Client *self)
+void client_update_normal_hints(ObClient *self)
{
XSizeHints size;
long ret;
}
}
-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 |
}
}
-static void client_change_allowed_actions(Client *self)
+static void client_change_allowed_actions(ObClient *self)
{
guint32 actions[9];
int num = 0;
}
}
-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
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;
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);
}
}
}
-void client_update_title(Client *self)
+void client_update_title(ObClient *self)
{
GList *it;
guint32 nums;
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;
}
self->icon_title = data;
}
-void client_update_class(Client *self)
+void client_update_class(ObClient *self)
{
char **data;
char *s;
if (self->role == NULL) self->role = g_strdup("");
}
-void client_update_strut(Client *self)
+void client_update_strut(ObClient *self)
{
guint num;
guint32 *data;
screen_update_areas();
}
-void client_update_icons(Client *self)
+void client_update_icons(ObClient *self)
{
guint num;
guint32 *data;
++self->nicons;
}
- self->icons = g_new(Icon, self->nicons);
+ self->icons = g_new(ObClientIcon, self->nicons);
/* store the icons */
i = 0;
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],
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,
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];
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;
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) {
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;
return client_search_focus_tree(self);
}
-static StackLayer calc_layer(Client *self)
+static StackLayer calc_layer(ObClient *self)
{
StackLayer 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 old, own;
}
}
-void client_calc_layer(Client *self)
+void client_calc_layer(ObClient *self)
{
StackLayer l;
- Client *orig;
+ ObClient *orig;
orig = self;
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 ||
return TRUE;
}
-static void client_showhide(Client *self)
+static void client_showhide(ObClient *self)
{
if (client_should_show(self))
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.. */
*/
}
-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_fullscreen(Client *self, gboolean fs, gboolean savearea)
+void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea)
{
int x, y, w, h;
client_focus(self);
}
-static void client_iconify_recursive(Client *self,
+static void client_iconify_recursive(ObClient *self,
gboolean iconic, gboolean curdesk)
{
GSList *it;
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);
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;
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 */
frame_adjust_area(self->frame, FALSE, FALSE);
}
-void client_close(Client *self)
+void client_close(ObClient *self)
{
XEvent ce;
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;
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;
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 */
}
}
-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;
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);
return self;
}
-gboolean client_can_focus(Client *self)
+gboolean client_can_focus(ObClient *self)
{
XEvent ev;
return TRUE;
}
-gboolean client_focus(Client *self)
+gboolean client_focus(ObClient *self)
{
/* choose the correct target */
self = client_focus_target(self);
return TRUE;
}
-void client_unfocus(Client *self)
+void client_unfocus(ObClient *self)
{
g_assert(focus_client == self);
#ifdef DEBUG_FOCUS
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);
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 */
}
/* 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)
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;
client_change_state(self); /* reflect this in the state hints */
}
-guint client_monitor(Client *self)
+guint client_monitor(ObClient *self)
{
guint 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 */
if (self->transient_for) {
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)
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 {
Decor_Close = 1 << 8 /*!< Display a close button */
} Decoration;
-typedef struct Client {
+struct _ObClient
+{
ObWindow obwin;
Window window;
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
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;
/*! 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();
/*! 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.
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
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
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
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
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
}
}
-void dispatch_x(XEvent *xe, Client *c)
+void dispatch_x(XEvent *xe, ObClient *c)
{
EventType e;
guint i;
}
}
-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;
}
}
-void dispatch_move(Client *c, int *x, int *y)
+void dispatch_move(ObClient *c, int *x, int *y)
{
guint i;
GSList *it;
*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;
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];
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;
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
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,
}
}
-static gboolean event_ignore(XEvent *e, Client *client)
+static gboolean event_ignore(XEvent *e, ObClient *client)
{
switch(e->type) {
case FocusIn:
static void event_process(XEvent *e)
{
Window window;
- Client *client = NULL;
+ ObClient *client = NULL;
Dock *dock = NULL;
DockApp *dockapp = NULL;
Menu *menu = NULL;
}
}
-static void event_handle_client(Client *client, XEvent *e)
+static void event_handle_client(ObClient *client, XEvent *e)
{
XEvent ce;
Atom msgtype;
}
}
-static void event_handle_menu(Client *client, XEvent *e)
+static void event_handle_menu(ObClient *client, XEvent *e)
{
static MenuEntry *over = NULL;
MenuEntry *entry;
#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()
event_lasttime);
}
-static void push_to_top(Client *client)
+static void push_to_top(ObClient *client)
{
guint desktop;
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);
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;
/* 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;
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))
void focus_fallback(FallbackType type)
{
GList *it;
- Client *old = NULL;
+ ObClient *old = NULL;
old = focus_client;
/* 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);
/* 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);
}
}
-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)
return NULL;
}
-void focus_order_add_new(Client *c)
+void focus_order_add_new(ObClient *c)
{
guint d, i;
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;
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) {
/* 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;
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) {
/* 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;
#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;
/*! 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 */
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
framerender_frame(self);
}
-void frame_grab_client(Frame *self, Client *client)
+void frame_grab_client(Frame *self, ObClient *client)
{
self->client = 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;
return Context_None;
}
-Context frame_context(Client *client, Window win)
+Context frame_context(ObClient *client, Window win)
{
Frame *self;
f->cbwidth)
typedef struct Frame {
- Client *client;
+ ObClient *client;
Window window;
Window plate;
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.
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;
g_hash_table_destroy(group_map);
}
-Group *group_add(Window leader, Client *client)
+Group *group_add(Window leader, ObClient *client)
{
Group *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);
if (self->members == NULL) {
#include <X11/Xlib.h>
#include <glib.h>
-struct Client;
+struct _ObClient;
typedef struct Group {
Window leader;
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
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)
{
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_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);
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;
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);
/* render stuff */
- Client *client;
+ ObClient *client;
Window frame;
Window title;
RrAppearance *a_title;
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);
#include <glib.h>
gboolean moveresize_in_progress = FALSE;
-Client *moveresize_client = NULL;
+ObClient *moveresize_client = NULL;
static gboolean moving = FALSE; /* TRUE - moving, FALSE - resizing */
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;
#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);
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;
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
/* 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);
}
/* 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);
}
/* 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);
}
/* 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);
}
/* 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);
}
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 {
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;
/* 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) {
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])) {
}
/* 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);
#include "geom.h"
#include "client.h"
-struct Client;
+struct _ObClient;
#define DESKTOP_ALL (0xffffffff)
/*! 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();
}
}
-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;
next = g_list_next(it);
if ((sit = g_slist_find(top->transients, it->data))) {
- Client *c = sit->data;
+ ObClient *c = sit->data;
++i;
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;
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);
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);
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)) {
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;
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;
}
g_assert_not_reached();
break;
case Window_Client:
- return ((Client*)self)->layer;
+ return ((ObClient*)self)->layer;
case Window_Internal:
return Layer_Internal;
}
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)
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()
/* 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;
}
}
-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;
}
}
-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)
{
return NULL;
}
-gboolean place_history(Client *c)
+gboolean place_history(ObClient *c)
{
struct HistoryItem *hi;
int x, y, w, h;
return FALSE;
}
-static void set_history(Client *c)
+static void set_history(ObClient *c)
{
struct HistoryItem *hi;
void history_startup();
void history_shutdown();
-gboolean place_history(Client *c);
+gboolean place_history(ObClient *c);
#endif
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;
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;
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;
/* 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))
}
}
-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)