6 #include "render2/render.h"
28 #define FRAME_HANDLE_Y(f) (f->size.top + f->client->area.height + \
31 typedef struct Frame {
41 struct RrSurface *s_frame;
42 struct RrSurface *s_title;
43 struct RrSurface *s_label;
44 struct RrSurface *s_max;
45 struct RrSurface *s_close;
46 struct RrSurface *s_desk;
47 struct RrSurface *s_shade;
48 struct RrSurface *s_iconify;
49 struct RrSurface *s_icon;
50 struct RrSurface *s_handle;
51 struct RrSurface *s_lgrip;
52 struct RrSurface *s_rgrip;
68 int width; /* title and handle */
70 int icon_x; /* x-position of the window icon button */
71 int label_x; /* x-position of the window title */
72 int iconify_x; /* x-position of the window iconify button */
73 int desk_x; /* x-position of the window all-desktops button */
74 int shade_x; /* x-position of the window shade button */
75 int max_x; /* x-position of the window maximize button */
76 int close_x; /* x-position of the window close button */
77 int bwidth; /* border width */
78 int cbwidth; /* client border width */
84 gboolean iconify_press;
90 void frame_shutdown();
93 void frame_show(Frame *self);
94 void frame_hide(Frame *self);
95 void frame_adjust_shape(Frame *self);
96 void frame_adjust_area(Frame *self, gboolean moved, gboolean resized);
97 void frame_adjust_state(Frame *self);
98 void frame_adjust_focus(Frame *self, gboolean hilite);
99 void frame_adjust_title(Frame *self);
100 void frame_adjust_icon(Frame *self);
101 void frame_grab_client(Frame *self, Client *client);
102 void frame_release_client(Frame *self, Client *client);
104 Context frame_context_from_string(char *name);
106 Context frame_context(Client *self, Window win);
108 /*! Applies gravity to the client's position to find where the frame should
110 @return The proper coordinates for the frame, based on the client.
112 void frame_client_gravity(Frame *self, int *x, int *y);
114 /*! Reversly applies gravity to the frame's position to find where the client
115 should be positioned.
116 @return The proper coordinates for the client, based on the frame.
118 void frame_frame_gravity(Frame *self, int *x, int *y);