X11workbench Toolkit  1.0
dialog_impl.c File Reference

Dialog box implementation file for standard types of dialog boxes. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <time.h>
#include <X11/keysymdef.h>
#include "window_helper.h"
#include "pixmap_helper.h"
#include "dialog_window.h"
#include "dialog_controls.h"
#include "conf_help.h"
#include "file_help.h"
#include "draw_text.h"

Go to the source code of this file.

Macros

#define XK_MISCELLANY   /* mostly for interix */
 
#define THIS_SUBSYSTEM   DebugSubSystem_Dialog
 
#define MESSAGE_BOX_WIDTH   400
 
#define MESSAGE_BOX_HEIGHT   100
 
#define MESSAGE_BOX_OFFSET   50
 
#define INPUT_BOX_WIDTH   400
 
#define INPUT_BOX_HEIGHT   120
 
#define FILE_DIALOG_PATH_TREE_CONTROL   1000
 
#define FILE_DIALOG_FILE_LIST_CONTROL   1001
 
#define FILE_DIALOG_FILE_NAME_CONTROL   1002
 
#define FILE_DIALOG_WIDTH   520
 
#define FILE_DIALOG_HEIGHT   500
 
#define LUMA_SAT_PICKER   1001
 
#define CHROMA_PICKER   1002
 
#define LUMA_BOX   1003
 
#define CHROMA_BOX   1004
 
#define SAT_BOX   1005
 
#define RED_BOX   1006
 
#define GREEN_BOX   1007
 
#define BLUE_BOX   1008
 
#define COLORBOX   1009
 
#define COLORBOX_VALUE   1010
 
#define COLOR_IMAGE_SIZE   256 /* note that dialog units are 2 pixels each */
 
#define CHROMA_RIBBON_HEIGHT   24 /* note that dialog units are 2 pixels each */
 
#define COLOR_IMAGE_COLOR_FACTOR   1 /* multiply by this to get 0-255 [effectively] */
 
#define COLORBOX_PIXMAP_WIDTH   96 /* width of 'colorbox' pixmap */
 
#define COLORBOX_PIXMAP_HEIGHT   24 /* height of 'colorbox' pixmap */
 
#define COLOR_DIALOG_WIDTH   560
 
#define COLOR_DIALOG_HEIGHT   364
 
#define SPLASH_FRAMERATE   30 /* make this configurable? */
 
#define SPLASH_TIME   1500 /* milliseconds */
 
#define GLEAM_WIDTH   29
 

Typedefs

typedef struct _SPLASH_ SPLASH
 

Functions

static int GetMessageBoxIconPixmapID (int iMBIconMask)
 
static int MessageBoxCallback (Window wID, XEvent *pEvent)
 
int DLGMessageBox (int iType, Window wIDOwner, const char *szTitle, const char *szMessage)
 Display a modal 'message box' dialog window with a specific title, message, and button combination. More...
 
static int InputBoxCallback (Window wID, XEvent *pEvent)
 
char * DLGInputBox (Window wIDOwner, const char *szTitle, const char *szPrompt, const char *szDefault, int iWidth, int iMaxChar)
 Displays a special purpose dialog window that retrieves a character string as input. More...
 
static int FileDialogCallback (Window wID, XEvent *pEvent)
 
char * DLGFileDialog (int iType, Window wIDOwner, const char *szDefPath, const char *szDefName, const char *szExtAndDescList)
 Display a modal File Dialog window, returning a WBAlloc'd pointer to a null-byte terminated string containing a fully qualified file or path name. More...
 
static void ColorDialogDumpData (const char *szCaption, struct _COLOR_DIALOG_ *pData)
 
static XImage * CreateLumaSaturationImage (Display *pDisplay, XStandardColormap *pSCM, int nChroma)
 
static XImage * CreateChromaImage (Display *pDisplay, XStandardColormap *pSCM)
 
static void ColorDialogImagesFromData (Display *pDisplay, WBDialogControl *pctrlLumaSat, WBDialogControl *pctrlChroma, struct _COLOR_DIALOG_ *pUserData)
 
static void ColorDialogDataFromPixel (struct _COLOR_DIALOG_ *pUserData)
 
static int ColorDialogRGBFromHSV (struct _COLOR_DIALOG_ *pUserData)
 
static int ColorDialogHSVFromRGB (struct _COLOR_DIALOG_ *pUserData)
 
static void ColorDialogAssignColorboxPixmap (Display *pDisplay, WBDialogControl *pCtrl, unsigned long lPixel)
 
static void ColorDialogAssignLumaSatPixmap (Display *pDisplay, WBDialogControl *pCtrl, int iS, int iV)
 
static void ColorDialogAssignChromaPixmap (Display *pDisplay, WBDialogControl *pCtrl, int iH)
 
static unsigned long ColorDialogGetPixelValueFromControl (WBDialogControl *pCtrl)
 
static int ColorDialogCallback (Window wID, XEvent *pEvent)
 
int DLGColorDialog (Window wIDOwner, XStandardColormap *pColorMap, XColor *pColor)
 Display a modal Color Dialog window, returning the selected color in the XColor structure pointed to by 'pColor'. More...
 
WB_FONT DLGFontDialog (Display *pDisplay, Window wIDOwner, WB_FONTC pDefault)
 Display a modal Font Dialog window, returning the selected font in the XColor structure pointed to by 'pColor'. More...
 
static int splash_callback (Window wID, XEvent *pEvent)
 
static int SplashDoExposeEvent (XExposeEvent *pEvent, Display *pDisplay, Window wID, struct _SPLASH_ *pData)
 
void DLGSplashScreen (char *aXPM[], const char *szCopyright, unsigned long clrText)
 Display a splash screen for 5 seconds (with animation and copyright string), and then return. More...
 

Variables

struct _MESSAGE_BOX_ __attribute__
 

Detailed Description

Dialog box implementation file for standard types of dialog boxes.

This file implements a number of standard dialog boxes including the 'file open' dialog box, message boxes, input boxes, and the splash screen.

Definition in file dialog_impl.c.