JWM Source Documentation
Data Structures | Macros | Typedefs | Functions | Variables
confirm.c File Reference

Confirm dialog functions. More...

#include "jwm.h"
#include "confirm.h"
#include "client.h"
#include "font.h"
#include "button.h"
#include "border.h"
#include "screen.h"
#include "misc.h"
#include "settings.h"
#include "key.h"

Go to the source code of this file.

Data Structures

struct  DialogType
 

Macros

#define DBS_NORMAL   0
 No button pressed.
 
#define DBS_OK   1
 OK pressed.
 
#define DBS_CANCEL   2
 Cancel pressed.
 

Typedefs

typedef unsigned char DialogButtonState
 Current state of dialog buttons.
 

Functions

static void RunDialogAction (void)
 Run the action associated with the current dialog.
 
static void DestroyConfirmDialog (void)
 Destroy a confirm dialog.
 
static void ComputeDimensions (const ClientNode *np)
 Compute the size of a dialog window.
 
static void DrawDialog (void)
 Render the dialog to the pixmap.
 
static void DrawButtons (void)
 Draw the buttons on the dialog window.
 
static void ExposeConfirmDialog (void)
 Copy the pixmap to the confirm dialog.
 
static char HandleDialogExpose (const XExposeEvent *event)
 Handle an expose event.
 
static char HandleDialogButtonPress (const XButtonEvent *event)
 Handle a mouse button release event.
 
static char HandleDialogButtonRelease (const XButtonEvent *event)
 Handle a mouse button release event.
 
static char HandleDialogKeyPress (const XKeyEvent *event)
 Handle a key press.
 
static const char * GetOKString ()
 
static const char * GetCancelString ()
 
void ShutdownDialogs (void)
 Stop dialog processing.
 
char ProcessDialogEvent (const XEvent *event)
 Handle an event on a dialog window.
 
void ShowConfirmDialog (ClientNode *np, void(*action)(ClientNode *),...)
 Show a confirm dialog.
 

Variables

static DialogTypedialog = NULL
 
static int minWidth = 0
 

Detailed Description

Confirm dialog functions.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file confirm.c.

Macro Definition Documentation

#define DBS_CANCEL   2

Cancel pressed.

Definition at line 27 of file confirm.c.

Referenced by DrawButtons(), and HandleDialogButtonPress().

#define DBS_NORMAL   0

No button pressed.

Definition at line 25 of file confirm.c.

Referenced by HandleDialogButtonPress(), HandleDialogButtonRelease(), and ShowConfirmDialog().

#define DBS_OK   1

OK pressed.

Definition at line 26 of file confirm.c.

Referenced by DrawButtons(), and HandleDialogButtonPress().

Typedef Documentation

typedef unsigned char DialogButtonState

Current state of dialog buttons.

Definition at line 24 of file confirm.c.

Function Documentation

void ComputeDimensions ( const ClientNode np)
static
void DestroyConfirmDialog ( void  )
static
void DrawButtons ( void  )
static
void DrawDialog ( void  )
static
void ExposeConfirmDialog ( void  )
static
static const char* GetCancelString ( )
static

Definition at line 72 of file confirm.c.

References _.

Referenced by ComputeDimensions(), and DrawButtons().

static const char* GetOKString ( )
static

Definition at line 67 of file confirm.c.

References _.

Referenced by ComputeDimensions(), and DrawButtons().

char HandleDialogButtonPress ( const XButtonEvent *  event)
static
char HandleDialogButtonRelease ( const XButtonEvent *  event)
static
char HandleDialogExpose ( const XExposeEvent *  event)
static

Handle an expose event.

Definition at line 121 of file confirm.c.

References Assert, ExposeConfirmDialog(), DialogType::node, and ClientNode::window.

Referenced by ProcessDialogEvent().

char HandleDialogKeyPress ( const XKeyEvent *  event)
static

Handle a key press.

Definition at line 229 of file confirm.c.

References DestroyConfirmDialog(), GetKey(), KEY_ENTER, KEY_ESC, DialogType::node, RunDialogAction(), and ClientNode::window.

Referenced by ProcessDialogEvent().

char ProcessDialogEvent ( const XEvent *  event)

Handle an event on a dialog window.

Definition at line 100 of file confirm.c.

References Assert, HandleDialogButtonPress(), HandleDialogButtonRelease(), HandleDialogExpose(), and HandleDialogKeyPress().

Referenced by WaitForEvent().

void RunDialogAction ( void  )
static

Run the action associated with the current dialog.

Definition at line 87 of file confirm.c.

References DialogType::action, DialogType::client, and FindClientByWindow().

Referenced by HandleDialogButtonRelease(), and HandleDialogKeyPress().

void ShowConfirmDialog ( ClientNode np,
void(*)(ClientNode *)  action,
  ... 
)
void ShutdownDialogs ( void  )

Stop dialog processing.

Definition at line 78 of file confirm.c.

References DestroyConfirmDialog().

Referenced by Shutdown().

Variable Documentation

DialogType* dialog = NULL
static

Definition at line 52 of file confirm.c.

int minWidth = 0
static

Definition at line 54 of file confirm.c.

Referenced by ComputeDimensions().

joewing.net / Projects / JWM