aboutsummaryrefslogtreecommitdiff
path: root/src/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c88
1 files changed, 64 insertions, 24 deletions
diff --git a/src/move.c b/src/move.c
index 7370f06..bce5d27 100644
--- a/src/move.c
+++ b/src/move.c
@@ -55,19 +55,25 @@ static int CheckBottomValid(const RectangleType *client,
/****************************************************************************
****************************************************************************/
-void SetSnapMode(SnapModeType mode) {
+void
+SetSnapMode(SnapModeType mode)
+{
snapMode = mode;
}
/****************************************************************************
****************************************************************************/
-void SetMoveMode(MoveModeType mode) {
+void
+SetMoveMode(MoveModeType mode)
+{
moveMode = mode;
}
/****************************************************************************
****************************************************************************/
-void SetSnapDistance(const char *value) {
+void
+SetSnapDistance(const char *value)
+{
int temp;
Assert(value);
@@ -84,13 +90,17 @@ void SetSnapDistance(const char *value) {
/****************************************************************************
****************************************************************************/
-void SetDefaultSnapDistance() {
+void
+SetDefaultSnapDistance()
+{
snapDistance = DEFAULT_SNAP_DISTANCE;
}
/****************************************************************************
****************************************************************************/
-void MoveController(int wasDestroyed) {
+void
+MoveController(int wasDestroyed)
+{
if(moveMode == MOVE_OUTLINE) {
ClearOutline();
@@ -106,7 +116,9 @@ void MoveController(int wasDestroyed) {
/****************************************************************************
****************************************************************************/
-int MoveClient(ClientNode *np, int startx, int starty) {
+int
+MoveClient(ClientNode *np, int startx, int starty)
+{
XEvent event;
int oldx, oldy;
@@ -208,7 +220,9 @@ int MoveClient(ClientNode *np, int startx, int starty) {
/****************************************************************************
****************************************************************************/
-int MoveClientKeyboard(ClientNode *np) {
+int
+MoveClientKeyboard(ClientNode *np)
+{
XEvent event;
int oldx, oldy;
@@ -339,7 +353,9 @@ int MoveClientKeyboard(ClientNode *np) {
/****************************************************************************
****************************************************************************/
-void StopMove(ClientNode *np, int doMove, int oldx, int oldy) {
+void
+StopMove(ClientNode *np, int doMove, int oldx, int oldy)
+{
int north, south, east, west;
@@ -367,7 +383,9 @@ void StopMove(ClientNode *np, int doMove, int oldx, int oldy) {
/****************************************************************************
****************************************************************************/
-void DoSnap(ClientNode *np, int north, int west) {
+void
+DoSnap(ClientNode *np, int north, int west)
+{
switch(snapMode) {
case SNAP_BORDER:
DoSnapBorder(np, north, west);
@@ -383,7 +401,9 @@ void DoSnap(ClientNode *np, int north, int west) {
/****************************************************************************
****************************************************************************/
-void DoSnapScreen(ClientNode *np, int north, int west) {
+void
+DoSnapScreen(ClientNode *np, int north, int west)
+{
RectangleType client;
int screen;
@@ -419,7 +439,9 @@ void DoSnapScreen(ClientNode *np, int north, int west) {
/****************************************************************************
****************************************************************************/
-void DoSnapBorder(ClientNode *np, int north, int west) {
+void
+DoSnapBorder(ClientNode *np, int north, int west)
+{
const ClientNode *tp;
const TrayType *tray;
@@ -530,7 +552,9 @@ void DoSnapBorder(ClientNode *np, int north, int west) {
/****************************************************************************
****************************************************************************/
-void ReturnToBorder(ClientNode *np, int north, int west) {
+void
+ReturnToBorder(ClientNode *np, int north, int west)
+{
const ScreenType *screen;
const TrayType *tray;
@@ -605,7 +629,9 @@ void ReturnToBorder(ClientNode *np, int north, int west) {
/****************************************************************************
****************************************************************************/
-int ShouldSnap(const ClientNode *np) {
+int
+ShouldSnap(const ClientNode *np)
+{
if(np->state.status & STAT_HIDDEN) {
return 0;
} else if(np->state.status & STAT_MINIMIZED) {
@@ -617,7 +643,9 @@ int ShouldSnap(const ClientNode *np) {
/****************************************************************************
****************************************************************************/
-void GetClientRectangle(const ClientNode *np, RectangleType *r) {
+void
+GetClientRectangle(const ClientNode *np, RectangleType *r)
+{
int border;
@@ -651,7 +679,9 @@ void GetClientRectangle(const ClientNode *np, RectangleType *r) {
/****************************************************************************
****************************************************************************/
-int CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b) {
+int
+CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b)
+{
if(a->top >= b->bottom) {
return 0;
} else if(a->bottom <= b->top) {
@@ -663,7 +693,9 @@ int CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b) {
/****************************************************************************
****************************************************************************/
-int CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b) {
+int
+CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b)
+{
if(a->left >= b->right) {
return 0;
} else if(a->right <= b->left) {
@@ -680,8 +712,10 @@ int CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b) {
* left - The top/bottom of the current left snap window.
* Returns 1 if the current left snap position is still valid, otherwise 0.
****************************************************************************/
-int CheckLeftValid(const RectangleType *client,
- const RectangleType *other, const RectangleType *left) {
+int
+CheckLeftValid(const RectangleType *client,
+ const RectangleType *other, const RectangleType *left)
+{
if(!left->valid) {
return 0;
@@ -711,8 +745,10 @@ int CheckLeftValid(const RectangleType *client,
/****************************************************************************
****************************************************************************/
-int CheckRightValid(const RectangleType *client,
- const RectangleType *other, const RectangleType *right) {
+int
+CheckRightValid(const RectangleType *client,
+ const RectangleType *other, const RectangleType *right)
+{
if(!right->valid) {
return 0;
@@ -742,8 +778,10 @@ int CheckRightValid(const RectangleType *client,
/****************************************************************************
****************************************************************************/
-int CheckTopValid(const RectangleType *client,
- const RectangleType *other, const RectangleType *top) {
+int
+CheckTopValid(const RectangleType *client,
+ const RectangleType *other, const RectangleType *top)
+{
if(!top->valid) {
return 0;
@@ -773,8 +811,10 @@ int CheckTopValid(const RectangleType *client,
/****************************************************************************
****************************************************************************/
-int CheckBottomValid(const RectangleType *client,
- const RectangleType *other, const RectangleType *bottom) {
+int
+CheckBottomValid(const RectangleType *client,
+ const RectangleType *other, const RectangleType *bottom)
+{
if(!bottom->valid) {
return 0;