6 #include "render/render.h"
28 #define FRAME_HANDLE_Y(f) (f->innersize.top + f->client->area.height + \
31 typedef struct Frame {
53 Appearance *a_unfocused_title;
54 Appearance *a_focused_title;
55 Appearance *a_unfocused_label;
56 Appearance *a_focused_label;
58 Appearance *a_unfocused_handle;
59 Appearance *a_focused_handle;
65 int width; /* title and handle */
67 int icon_x; /* x-position of the window icon button */
68 int label_x; /* x-position of the window title */
69 int iconify_x; /* x-position of the window iconify button */
70 int desk_x; /* x-position of the window all-desktops button */
71 int shade_x; /* x-position of the window shade button */
72 int max_x; /* x-position of the window maximize button */
73 int close_x; /* x-position of the window close button */
74 int bwidth; /* border width */
75 int cbwidth; /* client border width */
81 gboolean iconify_press;
87 void frame_shutdown();
90 void frame_show(Frame *self);
91 void frame_hide(Frame *self);
92 void frame_adjust_shape(Frame *self);
93 void frame_adjust_area(Frame *self, gboolean moved, gboolean resized);
94 void frame_adjust_state(Frame *self);
95 void frame_adjust_focus(Frame *self, gboolean hilite);
96 void frame_adjust_title(Frame *self);
97 void frame_adjust_icon(Frame *self);
98 void frame_grab_client(Frame *self, Client *client);
99 void frame_release_client(Frame *self, Client *client);
101 Context frame_context_from_string(char *name);
103 Context frame_context(Client *self, Window win);
105 /*! Applies gravity to the client's position to find where the frame should
107 @return The proper coordinates for the frame, based on the client.
109 void frame_client_gravity(Frame *self, int *x, int *y);
111 /*! Reversly applies gravity to the frame's position to find where the client
112 should be positioned.
113 @return The proper coordinates for the client, based on the frame.
115 void frame_frame_gravity(Frame *self, int *x, int *y);