]>
Dogcows Code - chaz/openbox/blob - openbox/frame.c
3 Context
frame_context_from_string(char *name
)
5 if (!g_ascii_strcasecmp("root", name
))
7 else if (!g_ascii_strcasecmp("client", name
))
9 else if (!g_ascii_strcasecmp("titlebar", name
))
10 return Context_Titlebar
;
11 else if (!g_ascii_strcasecmp("handle", name
))
12 return Context_Handle
;
13 else if (!g_ascii_strcasecmp("frame", name
))
15 else if (!g_ascii_strcasecmp("blcorner", name
))
16 return Context_BLCorner
;
17 else if (!g_ascii_strcasecmp("tlcorner", name
))
18 return Context_TLCorner
;
19 else if (!g_ascii_strcasecmp("brcorner", name
))
20 return Context_BRCorner
;
21 else if (!g_ascii_strcasecmp("trcorner", name
))
22 return Context_TRCorner
;
23 else if (!g_ascii_strcasecmp("maximize", name
))
24 return Context_Maximize
;
25 else if (!g_ascii_strcasecmp("alldesktops", name
))
26 return Context_AllDesktops
;
27 else if (!g_ascii_strcasecmp("shade", name
))
29 else if (!g_ascii_strcasecmp("iconify", name
))
30 return Context_Iconify
;
31 else if (!g_ascii_strcasecmp("icon", name
))
33 else if (!g_ascii_strcasecmp("close", name
))
38 void frame_client_gravity(Frame
*self
, int *x
, int *y
)
41 switch (self
->client
->gravity
) {
43 case NorthWestGravity
:
44 case SouthWestGravity
:
51 *x
-= (self
->size
.left
+ self
->size
.right
) / 2;
54 case NorthEastGravity
:
55 case SouthEastGravity
:
57 *x
-= self
->size
.left
+ self
->size
.right
;
62 *x
-= self
->size
.left
;
67 switch (self
->client
->gravity
) {
69 case NorthWestGravity
:
70 case NorthEastGravity
:
77 *y
-= (self
->size
.top
+ self
->size
.bottom
) / 2;
80 case SouthWestGravity
:
81 case SouthEastGravity
:
83 *y
-= self
->size
.top
+ self
->size
.bottom
;
93 void frame_frame_gravity(Frame
*self
, int *x
, int *y
)
96 switch (self
->client
->gravity
) {
98 case NorthWestGravity
:
100 case SouthWestGravity
:
105 *x
+= (self
->size
.left
+ self
->size
.right
) / 2;
107 case NorthEastGravity
:
109 case SouthEastGravity
:
110 *x
+= self
->size
.left
+ self
->size
.right
;
114 *x
+= self
->size
.left
;
119 switch (self
->client
->gravity
) {
121 case NorthWestGravity
:
123 case SouthWestGravity
:
128 *y
+= (self
->size
.top
+ self
->size
.bottom
) / 2;
130 case NorthEastGravity
:
132 case SouthEastGravity
:
133 *y
+= self
->size
.top
+ self
->size
.bottom
;
137 *y
+= self
->size
.top
;
This page took 0.040576 seconds and 4 git commands to generate.