5 #include "render/render.h"
7 typedef struct _ObFrame ObFrame
;
12 OB_FRAME_CONTEXT_NONE
,
13 OB_FRAME_CONTEXT_ROOT
,
14 OB_FRAME_CONTEXT_CLIENT
,
15 OB_FRAME_CONTEXT_TITLEBAR
,
16 OB_FRAME_CONTEXT_HANDLE
,
17 OB_FRAME_CONTEXT_FRAME
,
18 OB_FRAME_CONTEXT_BLCORNER
,
19 OB_FRAME_CONTEXT_BRCORNER
,
20 OB_FRAME_CONTEXT_TLCORNER
,
21 OB_FRAME_CONTEXT_TRCORNER
,
22 OB_FRAME_CONTEXT_MAXIMIZE
,
23 OB_FRAME_CONTEXT_ALLDESKTOPS
,
24 OB_FRAME_CONTEXT_SHADE
,
25 OB_FRAME_CONTEXT_ICONIFY
,
26 OB_FRAME_CONTEXT_ICON
,
27 OB_FRAME_CONTEXT_CLOSE
,
31 /*! The decorations the client window wants to be displayed on it */
33 OB_FRAME_DECOR_TITLEBAR
= 1 << 0, /*!< Display a titlebar */
34 OB_FRAME_DECOR_HANDLE
= 1 << 1, /*!< Display a handle (bottom) */
35 OB_FRAME_DECOR_GRIPS
= 1 << 2, /*!< Display grips in the handle */
36 OB_FRAME_DECOR_BORDER
= 1 << 3, /*!< Display a border */
37 OB_FRAME_DECOR_ICON
= 1 << 4, /*!< Display the window's icon */
38 OB_FRAME_DECOR_ICONIFY
= 1 << 5, /*!< Display an iconify button */
39 OB_FRAME_DECOR_MAXIMIZE
= 1 << 6, /*!< Display a maximize button */
40 /*! Display a button to toggle the window's placement on
42 OB_FRAME_DECOR_ALLDESKTOPS
= 1 << 7,
43 OB_FRAME_DECOR_SHADE
= 1 << 8, /*!< Displays a shade button */
44 OB_FRAME_DECOR_CLOSE
= 1 << 9 /*!< Display a close button */
49 struct _ObClient
*client
;
74 RrAppearance
*a_unfocused_title
;
75 RrAppearance
*a_focused_title
;
76 RrAppearance
*a_unfocused_label
;
77 RrAppearance
*a_focused_label
;
79 RrAppearance
*a_unfocused_handle
;
80 RrAppearance
*a_focused_handle
;
86 gint width
; /* title and handle */
88 gint icon_x
; /* x-position of the window icon button */
89 gint label_x
; /* x-position of the window title */
90 gint iconify_x
; /* x-position of the window iconify button */
91 gint desk_x
; /* x-position of the window all-desktops button */
92 gint shade_x
; /* x-position of the window shade button */
93 gint max_x
; /* x-position of the window maximize button */
94 gint close_x
; /* x-position of the window close button */
95 gint bwidth
; /* border width */
96 gint cbwidth
; /* client border width */
101 gboolean shade_press
;
102 gboolean iconify_press
;
104 gboolean close_hover
;
106 gboolean shade_hover
;
107 gboolean iconify_hover
;
112 ObFrame
*frame_new();
113 void frame_show(ObFrame
*self
);
114 void frame_hide(ObFrame
*self
);
115 void frame_adjust_shape(ObFrame
*self
);
116 void frame_adjust_area(ObFrame
*self
, gboolean moved
, gboolean resized
);
117 void frame_adjust_state(ObFrame
*self
);
118 void frame_adjust_focus(ObFrame
*self
, gboolean hilite
);
119 void frame_adjust_title(ObFrame
*self
);
120 void frame_adjust_icon(ObFrame
*self
);
121 void frame_grab_client(ObFrame
*self
, struct _ObClient
*client
);
122 void frame_release_client(ObFrame
*self
, struct _ObClient
*client
);
124 ObFrameContext
frame_context_from_string(char *name
);
126 ObFrameContext
frame_context(struct _ObClient
*self
, Window win
);
128 /*! Applies gravity to the client's position to find where the frame should
130 @return The proper coordinates for the frame, based on the client.
132 void frame_client_gravity(ObFrame
*self
, int *x
, int *y
);
134 /*! Reversly applies gravity to the frame's position to find where the client
135 should be positioned.
136 @return The proper coordinates for the client, based on the frame.
138 void frame_frame_gravity(ObFrame
*self
, int *x
, int *y
);