JWM Source Documentation
Functions
cursor.h File Reference

Header for the cursor functions. More...

#include "border.h"

Go to the source code of this file.

Functions

char GrabMouseForResize (BorderActionType action)
 Grab the mouse for resizing a window.
 
char GrabMouseForMove (void)
 Grab the mouse for moving a window.
 
char GrabMouse (Window w)
 Grab the mouse.
 
char GrabMouseForChoose (void)
 Grab the mouse to select a window.
 
Cursor GetFrameCursor (BorderActionType action)
 Get the cursor to use given a border action.
 
void MoveMouse (Window win, int x, int y)
 Move the mouse cursor.
 
void SetMousePosition (int x, int y, Window w)
 Set the current mouse position.
 
void GetMousePosition (int *x, int *y, Window *w)
 Get the current mouse position.
 
unsigned int GetMouseMask (void)
 Get a mask of the current mouse buttons pressed.
 
void SetDefaultCursor (Window w)
 Reset to the default cursor on a window.
 
#define InitializeCursors()   (void)(0)
 
#define DestroyCursors()   (void)(0)
 
void StartupCursors (void)
 Startup cursor support.
 
void ShutdownCursors (void)
 Shutdown cursor support.
 

Detailed Description

Header for the cursor functions.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file cursor.h.

Macro Definition Documentation

#define DestroyCursors ( )    (void)(0)

Definition at line 19 of file cursor.h.

Referenced by Destroy().

#define InitializeCursors ( )    (void)(0)

Definition at line 16 of file cursor.h.

Referenced by Initialize().

Function Documentation

Cursor GetFrameCursor ( BorderActionType  action)

Get the cursor to use given a border action.

Parameters
actionThe border action.
Returns
The cursor to use.

Definition at line 90 of file cursor.c.

References BA_CLOSE, BA_MAXIMIZE, BA_MINIMIZE, BA_MOVE, BA_RESIZE, CURSOR_DEFAULT, cursors, and GetResizeCursor().

Referenced by GrabMouseForResize(), HandleEnterNotify(), and HandleMotionNotify().

unsigned int GetMouseMask ( void  )

Get a mask of the current mouse buttons pressed.

Returns
A mask of the current mouse buttons pressed.

Definition at line 244 of file cursor.c.

References display, JXQueryPointer, mousew, mousex, mousey, and rootWindow.

Referenced by MoveClient(), ResizeClient(), and StartPagerMove().

void GetMousePosition ( int *  x,
int *  y,
Window *  w 
)

Get the current mouse position.

Parameters
xLocation to store the x-coordinate.
yLocation to store the y-coordinate.
wThe window under the mouse.

Definition at line 236 of file cursor.c.

References mousew, mousex, and mousey.

Referenced by GetMouseScreen(), MenuLoop(), RunTaskBarCommand(), ShowClientList(), ShowMenu(), ShowPopup(), and Signal().

char GrabMouse ( Window  w)

Grab the mouse.

Returns
1 on success, 0 on failure.

Definition at line 175 of file cursor.c.

References CURSOR_DEFAULT, cursors, display, JLIKELY, JXGrabPointer, and mousew.

Referenced by ProcessActionPress(), and ShowMenu().

char GrabMouseForChoose ( void  )

Grab the mouse to select a window.

Returns
1 on success, 0 on failure.

Definition at line 192 of file cursor.c.

References CURSOR_CHOOSE, cursors, display, JLIKELY, JXGrabPointer, mousew, and rootWindow.

Referenced by ChooseWindow().

char GrabMouseForMove ( void  )

Grab the mouse for moving a window.

Returns
1 on success, 0 on failure.

Definition at line 158 of file cursor.c.

References CURSOR_MOVE, cursors, display, JLIKELY, JXGrabPointer, mousew, and rootWindow.

Referenced by MoveClient(), MoveClientKeyboard(), and StartPagerMove().

char GrabMouseForResize ( BorderActionType  action)

Grab the mouse for resizing a window.

Parameters
actionThe resize action.
Returns
1 on success, 0 on failure.

Definition at line 138 of file cursor.c.

References display, GetFrameCursor(), JLIKELY, JXGrabPointer, mousew, and rootWindow.

Referenced by ResizeClient(), and ResizeClientKeyboard().

void MoveMouse ( Window  win,
int  x,
int  y 
)

Move the mouse cursor.

Parameters
winThe window to act as an origin for the coordinates.
xThe x-coordinate.
yThe y-coordinate.

Definition at line 217 of file cursor.c.

References display, JXQueryPointer, JXWarpPointer, mousew, mousex, mousey, and rootWindow.

Referenced by MapMenu(), MoveClient(), MoveClientKeyboard(), ResizeClientKeyboard(), RunTaskBarCommand(), and SetPosition().

void SetDefaultCursor ( Window  w)

Reset to the default cursor on a window.

Parameters
wThe window whose cursor to change.

Definition at line 209 of file cursor.c.

References CURSOR_DEFAULT, cursors, display, JLIKELY, and JXDefineCursor.

Referenced by AddClientWindow(), HandleEnterNotify(), MoveClient(), MoveClientKeyboard(), Startup(), StartupTray(), and StopMove().

void SetMousePosition ( int  x,
int  y,
Window  w 
)

Set the current mouse position.

Parameters
xThe x-coordinate (relative to the current desktop).
yThe y-coordinate (relative to the current desktop).
wThe window under the mouse.

Definition at line 228 of file cursor.c.

References mousew, mousex, mousey, ClientNode::x, and ClientNode::y.

Referenced by DiscardEnterEvents(), DiscardMotionEvents(), HandleKeyPress(), ResizeClient(), ResizeClientKeyboard(), ShowTray(), StartPagerMove(), UpdateMotion(), and WaitForEvent().

void ShutdownCursors ( void  )

Shutdown cursor support.

Definition at line 81 of file cursor.c.

References CURSOR_COUNT, cursors, display, JXFreeCursor, and ClientNode::x.

Referenced by Shutdown().

void StartupCursors ( void  )

Startup cursor support.

Definition at line 57 of file cursor.c.

References CreateCursor(), CURSOR_COUNT, cursor_shapes, cursors, display, JXQueryPointer, mousew, mousex, mousey, rootWindow, and ClientNode::x.

Referenced by Startup().

joewing.net / Projects / JWM