]> Dogcows Code - chaz/openbox/blob - openbox/frame.h
rename the Client struct to ObClient
[chaz/openbox] / openbox / frame.h
1 #ifndef __frame_h
2 #define __frame_h
3
4 #include "geom.h"
5 #include "client.h"
6 #include "render/render.h"
7
8 typedef enum {
9 Context_None,
10 Context_Root,
11 Context_Client,
12 Context_Titlebar,
13 Context_Handle,
14 Context_Frame,
15 Context_BLCorner,
16 Context_BRCorner,
17 Context_TLCorner,
18 Context_TRCorner,
19 Context_Maximize,
20 Context_AllDesktops,
21 Context_Shade,
22 Context_Iconify,
23 Context_Icon,
24 Context_Close,
25 NUM_CONTEXTS
26 } Context;
27
28 #define FRAME_HANDLE_Y(f) (f->innersize.top + f->client->area.height + \
29 f->cbwidth)
30
31 typedef struct Frame {
32 ObClient *client;
33
34 Window window;
35 Window plate;
36
37 Strut size;
38 Rect area;
39 gboolean visible;
40 int decorations;
41
42 Window title;
43 Window label;
44 Window max;
45 Window close;
46 Window desk;
47 Window shade;
48 Window icon;
49 Window iconify;
50 Window handle;
51 Window lgrip;
52 Window rgrip;
53
54 RrAppearance *a_unfocused_title;
55 RrAppearance *a_focused_title;
56 RrAppearance *a_unfocused_label;
57 RrAppearance *a_focused_label;
58 RrAppearance *a_icon;
59 RrAppearance *a_unfocused_handle;
60 RrAppearance *a_focused_handle;
61
62 Strut innersize;
63
64 GSList *clients;
65
66 int width; /* title and handle */
67 int label_width;
68 int icon_x; /* x-position of the window icon button */
69 int label_x; /* x-position of the window title */
70 int iconify_x; /* x-position of the window iconify button */
71 int desk_x; /* x-position of the window all-desktops button */
72 int shade_x; /* x-position of the window shade button */
73 int max_x; /* x-position of the window maximize button */
74 int close_x; /* x-position of the window close button */
75 int bwidth; /* border width */
76 int cbwidth; /* client border width */
77
78 gboolean max_press;
79 gboolean close_press;
80 gboolean desk_press;
81 gboolean shade_press;
82 gboolean iconify_press;
83
84 gboolean focused;
85 } Frame;
86
87 void frame_startup();
88 void frame_shutdown();
89
90 Frame *frame_new();
91 void frame_show(Frame *self);
92 void frame_hide(Frame *self);
93 void frame_adjust_shape(Frame *self);
94 void frame_adjust_area(Frame *self, gboolean moved, gboolean resized);
95 void frame_adjust_state(Frame *self);
96 void frame_adjust_focus(Frame *self, gboolean hilite);
97 void frame_adjust_title(Frame *self);
98 void frame_adjust_icon(Frame *self);
99 void frame_grab_client(Frame *self, ObClient *client);
100 void frame_release_client(Frame *self, ObClient *client);
101
102 Context frame_context_from_string(char *name);
103
104 Context frame_context(ObClient *self, Window win);
105
106 /*! Applies gravity to the client's position to find where the frame should
107 be positioned.
108 @return The proper coordinates for the frame, based on the client.
109 */
110 void frame_client_gravity(Frame *self, int *x, int *y);
111
112 /*! Reversly applies gravity to the frame's position to find where the client
113 should be positioned.
114 @return The proper coordinates for the client, based on the frame.
115 */
116 void frame_frame_gravity(Frame *self, int *x, int *y);
117
118
119 #endif
This page took 0.037954 seconds and 5 git commands to generate.