dmxconsole.c File Reference
#include "dmxinputinit.h"
#include "dmxevents.h"
#include "dmxconsole.h"
#include "dmxcommon.h"
#include "dmxscrinit.h"
#include "dmxcb.h"
#include "dmxsync.h"
#include "inputstr.h"
#include "input.h"
#include "mipointer.h"
#include "windowstr.h"

Data Structures

struct  _myPrivate

Defines

#define DMX_CONSOLE_DEBUG   0
#define DMX_WINDOW_DEBUG   0
#define CONSOLE_NUM   3
#define CONSOLE_DEN   4
#define DMX_CONSOLE_NAME   "DMX Console"
#define DMX_RES_NAME   "Xdmx"
#define DMX_RES_CLASS   "XDmx"
#define CONSOLE_BG_COLOR   "gray75"
#define CONSOLE_FG_COLOR   "black"
#define CONSOLE_SCREEN_BG_COLOR   "white"
#define CONSOLE_SCREEN_FG_COLOR   "black"
#define CONSOLE_SCREEN_DET_COLOR   "gray75"
#define CONSOLE_SCREEN_CUR_COLOR   "red"
#define DMXDBG0(f)
#define DMXDBG1(f, a)
#define DMXDBG2(f, a, b)
#define DMXDBG3(f, a, b, c)
#define DMXDBG4(f, a, b, c, d)
#define DMXDBG5(f, a, b, c, d, e)
#define DMXDBG6(f, a, b, c, d, e, g)
#define DMXDBG7(f, a, b, c, d, e, g, h)

Typedefs

typedef struct _myPrivate myPrivate

Functions

static int scalex (myPrivate *priv, int x)
static int scaley (myPrivate *priv, int y)
static int unscalex (myPrivate *priv, int x)
static int unscaley (myPrivate *priv, int y)
pointer dmxConsoleCreatePrivate (DeviceIntPtr pDevice)
void dmxConsoleDestroyPrivate (pointer private)
static void dmxConsoleDrawFineCursor (myPrivate *priv, XRectangle *rect)
static void dmxConsoleDrawWindows (pointer private)
static void dmxConsoleDraw (myPrivate *priv, int updateCursor, int update)
static void dmxConsoleClearCursor (myPrivate *priv, int x, int y, XRectangle *rect)
static void dmxConsoleUpdateFineCursor (myPrivate *priv)
void dmxConsoleUpdateInfo (pointer private, DMXUpdateType type, WindowPtr pWindow)
static void dmxConsoleMoveAbsolute (myPrivate *priv, int x, int y, DevicePtr pDev, dmxMotionProcPtr motion, DMXBlockType block)
static void dmxConsoleMoveRelative (myPrivate *priv, int x, int y, DevicePtr pDev, dmxMotionProcPtr motion, DMXBlockType block)
void dmxConsoleUpdatePosition (pointer private, int x, int y)
void dmxConsoleCollectEvents (DevicePtr pDev, dmxMotionProcPtr motion, dmxEnqueueProcPtr enqueue, dmxCheckSpecialProcPtr checkspecial, DMXBlockType block)
static void dmxCloseConsole (myPrivate *priv)
static Bool dmxCloseConsoleScreen (int idx, ScreenPtr pScreen)
static Cursor dmxConsoleCreateEmptyCursor (myPrivate *priv)
static void dmxConsoleComputeWidthHeight (myPrivate *priv, int *width, int *height, double *xScale, double *yScale, int *consWidth, int *consHeight)
void dmxConsoleReInit (DevicePtr pDev)
void dmxConsoleInit (DevicePtr pDev)
void dmxConsoleMouGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)
void dmxConsoleKbdGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)
int dmxConsoleFunctions (pointer private, DMXFunctionType function)
static void dmxDump (void)
void dmxConsoleCapture (DMXInputInfo *dmxInput)
void dmxConsoleUncapture (DMXInputInfo *dmxInput)

Detailed Description

This file implements the console input devices.


Define Documentation

#define CONSOLE_BG_COLOR   "gray75"

Referenced by dmxConsoleInit().

#define CONSOLE_DEN   4
#define CONSOLE_FG_COLOR   "black"
#define CONSOLE_NUM   3
#define CONSOLE_SCREEN_BG_COLOR   "white"

Referenced by dmxConsoleInit().

#define CONSOLE_SCREEN_CUR_COLOR   "red"

Referenced by dmxConsoleInit().

#define CONSOLE_SCREEN_DET_COLOR   "gray75"

Referenced by dmxConsoleInit().

#define CONSOLE_SCREEN_FG_COLOR   "black"

Referenced by dmxConsoleInit().

#define DMX_CONSOLE_DEBUG   0
#define DMX_CONSOLE_NAME   "DMX Console"

Referenced by dmxConsoleInit().

#define DMX_RES_CLASS   "XDmx"

Referenced by dmxConsoleInit().

#define DMX_RES_NAME   "Xdmx"

Referenced by dmxConsoleInit().

#define DMX_WINDOW_DEBUG   0
#define DMXDBG0 (   f)
#define DMXDBG1 (   f,
 
)
#define DMXDBG2 (   f,
  a,
 
)
#define DMXDBG3 (   f,
  a,
  b,
 
)

Referenced by dmxConsoleCapture().

#define DMXDBG4 (   f,
  a,
  b,
  c,
 
)
#define DMXDBG5 (   f,
  a,
  b,
  c,
  d,
 
)

Referenced by dmxConsoleCollectEvents().

#define DMXDBG6 (   f,
  a,
  b,
  c,
  d,
  e,
 
)
#define DMXDBG7 (   f,
  a,
  b,
  c,
  d,
  e,
  g,
 
)

Typedef Documentation

typedef struct _myPrivate myPrivate

Function Documentation

static Bool dmxCloseConsoleScreen ( int  idx,
ScreenPtr  pScreen 
) [static]
void dmxConsoleCapture ( DMXInputInfo dmxInput)

This routine is used to warp the pointer into the console window from anywhere on the screen. It is used when backend and console input are both being taken from the same X display.

References _myPrivate::captured, _myPrivate::curX, _myPrivate::curY, _DMXInputInfo::devs, DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_CONSOLE, dmxConsoleUpdateFineCursor(), DMXDBG0, DMXDBG3, dmxDump(), dmxSync(), _DMXLocalInputInfo::extType, _myPrivate::fine, _DMXInputInfo::name, _DMXInputInfo::numDevs, _DMXLocalInputInfo::private, and _DMXLocalInputInfo::type.

Referenced by dmxBackendUpdatePosition().

static void dmxConsoleClearCursor ( myPrivate priv,
int  x,
int  y,
XRectangle *  rect 
) [static]
void dmxConsoleCollectEvents ( DevicePtr  pDev,
dmxMotionProcPtr  motion,
dmxEnqueueProcPtr  enqueue,
dmxCheckSpecialProcPtr  checkspecial,
DMXBlockType  block 
)

Collect all pending events from the console's display. Plase these events on the server event queue using the motion and enqueue routines. The checkspecial routine is used to check for special keys that need handling. block tells if signals should be blocked when updating the event queue.

References dmxCommonRestoreState(), dmxCommonSaveState(), dmxConsoleDraw(), dmxConsoleMoveAbsolute(), dmxConsoleMoveRelative(), dmxConsoleUncapture(), DMXDBG2, DMXDBG4, DMXDBG5, DMXDBG6, _myPrivate::dmxInput, GETDMXINPUTFROMPRIV, GETPRIVFROMPDEV, _myPrivate::height, and _myPrivate::width.

static void dmxConsoleComputeWidthHeight ( myPrivate priv,
int *  width,
int *  height,
double *  xScale,
double *  yScale,
int *  consWidth,
int *  consHeight 
) [static]
static Cursor dmxConsoleCreateEmptyCursor ( myPrivate priv) [static]

References dmxFatal, dmxLog(), and _myPrivate::pixmap.

Referenced by dmxConsoleInit().

pointer dmxConsoleCreatePrivate ( DeviceIntPtr  pDevice)

Create the private area for pDevice.

References GETDMXLOCALFROMPDEVICE.

void dmxConsoleDestroyPrivate ( pointer  private)

If private is non-NULL, free its associated memory.

static void dmxConsoleDrawFineCursor ( myPrivate priv,
XRectangle *  rect 
) [static]
static void dmxConsoleDrawWindows ( pointer  private) [static]
int dmxConsoleFunctions ( pointer  private,
DMXFunctionType  function 
)
static void dmxConsoleMoveAbsolute ( myPrivate priv,
int  x,
int  y,
DevicePtr  pDev,
dmxMotionProcPtr  motion,
DMXBlockType  block 
) [static]
static void dmxConsoleMoveRelative ( myPrivate priv,
int  x,
int  y,
DevicePtr  pDev,
dmxMotionProcPtr  motion,
DMXBlockType  block 
) [static]
void dmxConsoleReInit ( DevicePtr  pDev)

Re-initialized the console device described by pDev (after a reconfig).

References dmxConsoleComputeWidthHeight(), dmxConsoleDraw(), and GETPRIVFROMPDEV.

void dmxConsoleUpdateInfo ( pointer  private,
DMXUpdateType  type,
WindowPtr  pWindow 
)

Whenever the window layout (size, position, stacking order) might be changed, this routine is called with the pWindow that changed and the type of change. This routine is called in a conservative fashion: the actual layout of the windows of the screen might not have had any human-visible changes.

References dmxConsoleDraw(), and GETONLYPRIVFROMPRIVATE.

void dmxConsoleUpdatePosition ( pointer  private,
int  x,
int  y 
)

This routine gets called from dmxCoreMotion for each motion. This allows the console's notion of the cursor postion to change when another input device actually caused the change.

References dmxConsoleDraw(), dmxConsoleUpdateFineCursor(), DMXDBG2, DMXDBG6, dmxGeneration, GETONLYPRIVFROMPRIVATE, scalex(), and scaley().

static int unscalex ( myPrivate priv,
int  x 
) [static]

References _myPrivate::xScale.

Referenced by dmxConsoleMoveAbsolute().

static int unscaley ( myPrivate priv,
int  y 
) [static]

References _myPrivate::yScale.

Referenced by dmxConsoleMoveAbsolute().