JWM Source Documentation
Enumerations | Functions | Variables
cursor.c File Reference

Cursor functions. More...

#include "jwm.h"
#include "cursor.h"
#include "main.h"

Go to the source code of this file.

Enumerations

enum  CursorType {
  CURSOR_DEFAULT, CURSOR_MOVE, CURSOR_NORTH, CURSOR_SOUTH,
  CURSOR_EAST, CURSOR_WEST, CURSOR_NE, CURSOR_NW,
  CURSOR_SE, CURSOR_SW, CURSOR_CHOOSE, CURSOR_COUNT
}
 Cursor types. More...
 

Functions

static Cursor GetResizeCursor (BorderActionType action)
 Get the cursor for resizing on the specified frame location.
 
static Cursor CreateCursor (unsigned int shape)
 Create a cursor for the specified shape.
 
void StartupCursors (void)
 Startup cursor support.
 
void ShutdownCursors (void)
 Shutdown cursor support.
 
Cursor GetFrameCursor (BorderActionType action)
 Get the cursor for the specified location on the frame.
 
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 for choosing a window.
 
void SetDefaultCursor (Window w)
 Set the default cursor for a window.
 
void MoveMouse (Window win, int x, int y)
 Move the mouse to the specified coordinates on a window.
 
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 the current mouse buttons pressed.
 

Variables

static const unsigned int cursor_shapes [CURSOR_COUNT]
 Cursors to load for the various cursor types.
 
static Cursor cursors [CURSOR_COUNT]
 
static int mousex
 
static int mousey
 
static Window mousew
 

Detailed Description

Cursor functions.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file cursor.c.

Enumeration Type Documentation

enum CursorType

Cursor types.

Enumerator:
CURSOR_DEFAULT 
CURSOR_MOVE 
CURSOR_NORTH 
CURSOR_SOUTH 
CURSOR_EAST 
CURSOR_WEST 
CURSOR_NE 
CURSOR_NW 
CURSOR_SE 
CURSOR_SW 
CURSOR_CHOOSE 
CURSOR_COUNT 

Definition at line 15 of file cursor.c.

Function Documentation

Cursor CreateCursor ( unsigned int  shape)
static

Create a cursor for the specified shape.

Definition at line 75 of file cursor.c.

References display, and JXCreateFontCursor.

Referenced by StartupCursors().

Cursor GetFrameCursor ( BorderActionType  action)

Get the cursor for the specified location on the frame.

Get the cursor to use given a border action.

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 the current mouse buttons pressed.

Get 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.

Definition at line 236 of file cursor.c.

References mousew, mousex, and mousey.

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

Cursor GetResizeCursor ( BorderActionType  action)
static

Get the cursor for resizing on the specified frame location.

Definition at line 110 of file cursor.c.

References BA_RESIZE_E, BA_RESIZE_N, BA_RESIZE_S, BA_RESIZE_W, CURSOR_DEFAULT, CURSOR_EAST, CURSOR_NE, CURSOR_NORTH, CURSOR_NW, CURSOR_SE, CURSOR_SOUTH, CURSOR_SW, CURSOR_WEST, and cursors.

Referenced by GetFrameCursor().

char GrabMouse ( Window  w)

Grab the mouse.

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 for choosing a window.

Grab the mouse to select a window.

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.

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.

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 to the specified coordinates on a window.

Move the mouse cursor.

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)

Set the default cursor for a window.

Reset to the default cursor on a window.

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 
)
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().

Variable Documentation

const unsigned int cursor_shapes[CURSOR_COUNT]
static
Initial value:
= {
XC_left_ptr,
XC_fleur,
XC_top_side,
XC_bottom_side,
XC_right_side,
XC_left_side,
XC_top_right_corner,
XC_top_left_corner,
XC_bottom_right_corner,
XC_bottom_left_corner,
XC_tcross
}

Cursors to load for the various cursor types.

This must be ordered the same as CursorType.

Definition at line 33 of file cursor.c.

Referenced by StartupCursors().

Cursor cursors[CURSOR_COUNT]
static
Window mousew
static
int mousex
static
int mousey
static

joewing.net / Projects / JWM