#ifndef __action_h
#define __action_h
-#include "client.h"
+#include "misc.h"
#include "parser/parse.h"
/* These have to all have a Client* at the top even if they don't use it, so
*/
struct AnyAction {
- ObClient *c;
+ struct _ObClient *c;
};
struct DirectionalAction{
- ObClient *c;
+ struct _ObClient *c;
ObDirection direction;
};
struct Execute {
- ObClient *c;
+ struct _ObClient *c;
char *path;
};
struct ClientAction {
- ObClient *c;
+ struct _ObClient *c;
};
struct MoveResizeRelative {
- ObClient *c;
+ struct _ObClient *c;
int delta;
};
struct SendToDesktop {
- ObClient *c;
+ struct _ObClient *c;
guint desk;
gboolean follow;
};
struct SendToDesktopDirection {
- ObClient *c;
+ struct _ObClient *c;
gboolean wrap;
gboolean follow;
};
struct Desktop {
- ObClient *c;
+ struct _ObClient *c;
guint desk;
};
struct Layer {
- ObClient *c;
+ struct _ObClient *c;
int layer; /* < 0 = below, 0 = normal, > 0 = above */
};
struct DesktopDirection {
- ObClient *c;
+ struct _ObClient *c;
gboolean wrap;
};
struct MoveResize {
- ObClient *c;
+ struct _ObClient *c;
int x;
int y;
guint32 corner; /* prop_atoms.net_wm_moveresize_* */
};
struct ShowMenu {
- ObClient *c;
+ struct _ObClient *c;
char *name;
int x;
int y;
};
struct CycleWindows {
- ObClient *c;
+ struct _ObClient *c;
gboolean linear;
gboolean forward;
gboolean final;
return client_search_focus_tree(self);
}
-static StackLayer calc_layer(ObClient *self)
+static ObStackingLayer calc_layer(ObClient *self)
{
- StackLayer l;
+ ObStackingLayer l;
- if (self->fullscreen) l = Layer_Fullscreen;
- else if (self->type == OB_CLIENT_TYPE_DESKTOP) l = Layer_Desktop;
+ if (self->fullscreen) l = OB_STACKING_LAYER_FULLSCREEN;
+ else if (self->type == OB_CLIENT_TYPE_DESKTOP)
+ l = OB_STACKING_LAYER_DESKTOP;
else if (self->type == OB_CLIENT_TYPE_DOCK) {
- if (!self->below) l = Layer_Top;
- else l = Layer_Normal;
+ if (!self->below) l = OB_STACKING_LAYER_TOP;
+ else l = OB_STACKING_LAYER_NORMAL;
}
- else if (self->above) l = Layer_Above;
- else if (self->below) l = Layer_Below;
- else l = Layer_Normal;
+ else if (self->above) l = OB_STACKING_LAYER_ABOVE;
+ else if (self->below) l = OB_STACKING_LAYER_BELOW;
+ else l = OB_STACKING_LAYER_NORMAL;
return l;
}
static void client_calc_layer_recursive(ObClient *self, ObClient *orig,
- StackLayer l, gboolean raised)
+ ObStackingLayer l, gboolean raised)
{
- StackLayer old, own;
+ ObStackingLayer old, own;
GSList *it;
old = self->layer;
void client_calc_layer(ObClient *self)
{
- StackLayer l;
+ ObStackingLayer l;
ObClient *orig;
orig = self;
/*! The layer in which the window will be stacked, windows in lower layers
are always below windows in higher layers. */
- StackLayer layer;
+ ObStackingLayer layer;
/*! A bitmask of values in the Decoration enum
The values in the variable are the decorations that the client wants to
gboolean config_opaque_move;
gboolean config_opaque_resize;
-StackLayer config_dock_layer;
-gboolean config_dock_floating;
-ObDirection config_dock_pos;
-int config_dock_x;
-int config_dock_y;
-ObOrientation config_dock_orient;
-gboolean config_dock_hide;
-guint config_dock_hide_timeout;
+ObStackingLayer config_dock_layer;
+gboolean config_dock_floating;
+ObDirection config_dock_pos;
+gint config_dock_x;
+gint config_dock_y;
+ObOrientation config_dock_orient;
+gboolean config_dock_hide;
+guint config_dock_hide_timeout;
static void parse_focus(xmlDocPtr doc, xmlNodePtr node, void *d)
{
}
if ((n = parse_find_node("stacking", node))) {
if (parse_contains("top", doc, n))
- config_dock_layer = Layer_Top;
+ config_dock_layer = OB_STACKING_LAYER_TOP;
else if (parse_contains("normal", doc, n))
- config_dock_layer = Layer_Normal;
+ config_dock_layer = OB_STACKING_LAYER_NORMAL;
else if (parse_contains("bottom", doc, n))
- config_dock_layer = Layer_Below;
+ config_dock_layer = OB_STACKING_LAYER_BELOW;
}
if ((n = parse_find_node("direction", node))) {
if (parse_contains("horizontal", doc, n))
parse_register("moveresize", parse_moveresize, NULL);
- config_dock_layer = Layer_Top;
+ config_dock_layer = OB_STACKING_LAYER_TOP;
config_dock_pos = OB_DIRECTION_NORTHEAST;
config_dock_floating = FALSE;
config_dock_x = 0;
#define __config_h
#include "misc.h"
-#include "dock.h"
#include "stacking.h"
#include <glib.h>
extern gboolean config_opaque_resize;
/*! The stacking layer the dock will reside in */
-extern StackLayer config_dock_layer;
+extern ObStackingLayer config_dock_layer;
/*! Is the dock floating */
extern gboolean config_dock_floating;
/*! Where to place the dock if not floating */
extern ObDirection config_dock_pos;
-/*! If config_dock_pos is DockPos_Floating, this is the top-left corner's
+/*! If config_dock_floating, this is the top-left corner's
position */
-extern int config_dock_x;
-/*! If config_dock_pos is DockPos_Floating, this is the top-left corner's
+extern gint config_dock_x;
+/*! If config_dock_floating, this is the top-left corner's
position */
-extern int config_dock_y;
+extern gint config_dock_y;
/*! Whether the dock places the dockapps in it horizontally or vertically */
extern ObOrientation config_dock_orient;
/*! Whether to auto-hide the dock when the pointer is not over it */
#include "dispatch.h"
#include "extensions.h"
+#include "client.h"
#include <glib.h>
#ifndef __dispatch_h
#define __dispatch_h
-#include "client.h"
+#include "misc.h"
+
#include <X11/Xlib.h>
+struct _ObClient;
+
void dispatch_startup();
void dispatch_shutdown();
typedef struct {
XEvent *e;
- ObClient *client;
+ struct _ObClient *client;
} EventData_X;
typedef struct {
- ObClient *client;
+ struct _ObClient *client;
int num[3];
- /* 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 --
+ /* 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 --
change these in the handler to adjust where the
window will be placed
- Event_ObClient_Resizing: num[0] = dest width, num[1] = dest height --
+ Event_Client_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_ObClient;
+} EventData_Client;
typedef struct {
int num[2];
typedef struct {
EventData_X x; /* for Event_X_* event types */
- EventData_ObClient c; /* for Event_ObClient_* event types */
+ EventData_Client 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, ObClient *c);
-void dispatch_client(EventType e, ObClient *c, int num0, int num1);
+void dispatch_x(XEvent *e, struct _ObClient *c);
+void dispatch_client(EventType e, struct _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(ObClient *c, int *x, int *y);
+void dispatch_move(struct _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(ObClient *c, int *w, int *h, ObCorner corner);
+void dispatch_resize(struct _ObClient *c, int *w, int *h, ObCorner corner);
#endif
CWOverrideRedirect | CWEventMask,
&attrib);
dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_unfocused_title);
- XSetWindowBorder(ob_display, dock->frame, ob_rr_theme->b_color->pixel);
+ XSetWindowBorder(ob_display, dock->frame,
+ RrColorPixel(ob_rr_theme->b_color));
XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
g_hash_table_insert(window_map, &dock->frame, dock);
/* are we a fullscreen window or a transient of one? (checks layer)
if we are then we need to be iconified since we are losing focus
*/
- if (client->layer == Layer_Fullscreen && !client->iconic &&
+ if (client->layer == OB_STACKING_LAYER_FULLSCREEN && !client->iconic &&
!client_search_focus_tree_full(client))
/* iconify fullscreen windows when they and their transients
aren't focused */
#ifndef __extensions_h
#define __extensions_h
+#include "geom.h"
+
#include <X11/Xlib.h>
#ifdef XKB
#include <X11/XKBlib.h>
#ifdef VIDMODE
#include <X11/extensions/xf86vmode.h>
#endif
+
#include <glib.h>
/*! Does the display have the XKB extension? */
#include "frame.h"
#include "openbox.h"
#include "screen.h"
+#include "client.h"
#include "framerender.h"
#include "render/theme.h"
{
if (self->focused)
XSetWindowBorder(ob_display, self->plate,
- ob_rr_theme->cb_focused_color->pixel);
+ RrColorPixel(ob_rr_theme->cb_focused_color));
else
XSetWindowBorder(ob_display, self->plate,
- ob_rr_theme->cb_unfocused_color->pixel);
+ RrColorPixel(ob_rr_theme->cb_unfocused_color));
if (self->client->decorations & Decor_Titlebar) {
RrAppearance *t, *l, *m, *n, *i, *d, *s, *c;
#ifndef __framerender_h
#define __framerender_h
-#include "frame.h"
+struct _ObFrame;
-void framerender_frame(ObFrame *self);
+void framerender_frame(struct _ObFrame *self);
#endif
#include "menu.h"
#include "openbox.h"
#include "stacking.h"
+#include "client.h"
#include "grab.h"
#include "screen.h"
#include "geom.h"
#define __menu_h
#include "action.h"
+#include "window.h"
#include "render/render.h"
#include "geom.h"
#include <glib.h>
+struct _ObClient;
+
struct Menu;
struct MenuEntry;
typedef void(*menu_controller_show)(struct Menu *self,
- int x, int y, ObClient *);
+ int x, int y, struct _ObClient *);
typedef void(*menu_controller_update)(struct Menu *self);
typedef void(*menu_controller_mouseover)(struct MenuEntry *self,
gboolean enter);
/* render stuff */
- ObClient *client;
+ struct _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, ObClient *client);
-void menu_show_full(Menu *menu, int x, int y, ObClient *client);
+void menu_show(char *name, int x, int y, struct _ObClient *client);
+void menu_show_full(Menu *menu, int x, int y, struct _ObClient *client);
void menu_hide(Menu *self);
if (self->a_title == NULL) {
XSetWindowBorderWidth(ob_display, self->frame, ob_rr_theme->bwidth);
XSetWindowBackground(ob_display, self->frame,
- ob_rr_theme->b_color->pixel);
+ RrColorPixel(ob_rr_theme->b_color));
XSetWindowBorderWidth(ob_display, self->title, ob_rr_theme->bwidth);
- XSetWindowBorder(ob_display, self->frame, ob_rr_theme->b_color->pixel);
- XSetWindowBorder(ob_display, self->title, ob_rr_theme->b_color->pixel);
+ XSetWindowBorder(ob_display, self->frame,
+ RrColorPixel(ob_rr_theme->b_color));
+ XSetWindowBorder(ob_display, self->title,
+ RrColorPixel(ob_rr_theme->b_color));
self->a_title = RrAppearanceCopy(ob_rr_theme->a_menu_title);
self->a_items = RrAppearanceCopy(ob_rr_theme->a_menu);
#include "screen.h"
#include "prop.h"
#include "client.h"
+#include "frame.h"
#include "dispatch.h"
#include "openbox.h"
#include "popup.h"
#ifndef __popup_h
#define __popup_h
-#include "client.h"
-
#include <glib.h>
+struct _ObClientIcon;
+
typedef struct _ObPopup Popup;
Popup *popup_new(gboolean hasicon);
void popup_size(Popup *self, gint w, gint h);
void popup_size_to_string(Popup *self, gchar *text);
-void popup_show(Popup *self, gchar *text, ObClientIcon *icon);
+void popup_show(Popup *self, gchar *text, struct _ObClientIcon *icon);
void popup_hide(Popup *self);
#endif
#include "misc.h"
#include "geom.h"
-#include "client.h"
struct _ObClient;
static void do_raise(GList *wins)
{
GList *it;
- GList *layer[NUM_STACKLAYER] = {NULL};
+ GList *layer[OB_NUM_STACKING_LAYERS] = {NULL};
int i;
for (it = wins; it; it = g_list_next(it)) {
- StackLayer l;
+ ObStackingLayer l;
l = window_layer(it->data);
layer[l] = g_list_append(layer[l], it->data);
}
it = stacking_list;
- for (i = NUM_STACKLAYER - 1; i >= 0; --i) {
+ for (i = OB_NUM_STACKING_LAYERS - 1; i >= 0; --i) {
if (layer[i]) {
for (; it; it = g_list_next(it)) {
/* look for the top of the layer */
- if (window_layer(it->data) <= (StackLayer) i)
+ if (window_layer(it->data) <= (ObStackingLayer) i)
break;
}
do_restack(layer[i], it);
static void do_lower(GList *wins)
{
GList *it;
- GList *layer[NUM_STACKLAYER] = {NULL};
+ GList *layer[OB_NUM_STACKING_LAYERS] = {NULL};
int i;
for (it = wins; it; it = g_list_next(it)) {
- StackLayer l;
+ ObStackingLayer l;
l = window_layer(it->data);
layer[l] = g_list_append(layer[l], it->data);
}
it = stacking_list;
- for (i = NUM_STACKLAYER - 1; i >= 0; --i) {
+ for (i = OB_NUM_STACKING_LAYERS - 1; i >= 0; --i) {
if (layer[i]) {
for (; it; it = g_list_next(it)) {
/* look for the top of the next layer down */
- if (window_layer(it->data) < (StackLayer) i)
+ if (window_layer(it->data) < (ObStackingLayer) i)
break;
}
do_restack(layer[i], it);
void stacking_add(ObWindow *win)
{
- StackLayer l;
+ ObStackingLayer l;
GList *wins;
g_assert(focus_backup != None); /* make sure I dont break this in the
/*! The possible stacking layers a client window can be a part of */
typedef enum {
- Layer_Desktop, /*!< 0 - desktop windows */
- Layer_Below, /*!< 1 - normal windows w/ below */
- Layer_Normal, /*!< 2 - normal windows */
- Layer_Above, /*!< 3 - normal windows w/ above */
- Layer_Top, /*!< 4 - always-on-top-windows (docks?) */
- Layer_Fullscreen, /*!< 5 - fullscreeen windows */
- Layer_Internal, /*!< 6 - openbox windows/menus */
- NUM_STACKLAYER
-} StackLayer;
+ OB_STACKING_LAYER_DESKTOP, /*!< 0 - desktop windows */
+ OB_STACKING_LAYER_BELOW, /*!< 1 - normal windows w/ below */
+ OB_STACKING_LAYER_NORMAL, /*!< 2 - normal windows */
+ OB_STACKING_LAYER_ABOVE, /*!< 3 - normal windows w/ above */
+ OB_STACKING_LAYER_TOP, /*!< 4 - always-on-top-windows (docks?) */
+ OB_STACKING_LAYER_FULLSCREEN, /*!< 5 - fullscreeen windows */
+ OB_STACKING_LAYER_INTERNAL, /*!< 6 - openbox windows/menus */
+ OB_NUM_STACKING_LAYERS
+} ObStackingLayer;
/* list of ObWindow*s in stacking order from highest to lowest */
extern GList *stacking_list;
{
switch (self->type) {
case Window_Menu:
- return Layer_Internal;
+ return OB_STACKING_LAYER_INTERNAL;
case Window_Dock:
return config_dock_layer;
case Window_DockApp:
case Window_Client:
return ((ObClient*)self)->layer;
case Window_Internal:
- return Layer_Internal;
+ return OB_STACKING_LAYER_INTERNAL;
}
g_assert_not_reached();
return None;
#include <X11/Xlib.h>
#include <glib.h>
+typedef struct _ObWindow ObWindow;
+typedef struct _ObInternalWindow ObInternalWindow;
+
typedef enum {
Window_Menu,
Window_Dock,
Window_Internal /* used for stacking but not events */
} Window_InternalType;
-typedef struct ObWindow {
+struct _ObWindow
+{
Window_InternalType type;
-} ObWindow;
+};
/* Wrapper for internal stuff. If its struct matches this then it can be used
as an ObWindow */
#include "kernel/openbox.h"
#include "kernel/event.h"
#include "kernel/grab.h"
+#include "kernel/client.h"
#include "kernel/action.h"
#include "kernel/prop.h"
#include "kernel/timer.h"