|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 3523 (0xdc3)
Types: TextFile
Names: »main.h«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/X/Dragon/main.h«
/******************************************************************************
* Dragon - a version of Mah-Jongg for X Windows
*
* Author: Gary E. Barnes March 1989
*
* main.h - #include'ed into all source files.
******************************************************************************/
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/IntrinsicP.h>
#include <X11/Shell.h>
#include <X11/Simple.h>
#include <X11/StringDefs.h>
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifdef _MAIN_C_
#define VAR(A) A
#define VARI(A,B) A = B
#else
#define VAR(A) extern A
#define VARI(A,B) extern A
#endif
\f
/******************************************************************************
* Dragon Resources
******************************************************************************/
typedef struct _Dragon_Resources_Rec{
Pixel Foreground; /* Default foreground color */
Pixel Background; /* Default background color */
Cursor Cursor; /* Name of cursor to use */
Boolean Debug; /* Debug printouts */
int Double_Click_Time; /* Time (ms) between clicks */
String Geometry; /* Geometry for the board */
String Icon_Geometry; /* Geometry for our icon */
Boolean Iconic; /* Do we start as an icon? */
String Icon_Name; /* Name for the icon */
Boolean Reverse_Video; /* Do all in reverse? */
Boolean Sticky_Tile; /* Is first tile sticky? */
Boolean Tile_Shadows; /* Want shadows? */
String Tile_Sides; /* What side type? */
} Dragon_Resources_Rec, *Dragon_Resources_Ptr;
#ifdef WANTDEBUG
#define DEBUG_CALL(Name) \
if (Dragon_Resources.Debug) { \
(void)fprintf( stderr, "Name call\n" ); (void)fflush(stderr); \
}
#define DEBUG_RETURN(Name) \
if (Dragon_Resources.Debug) { \
(void)fprintf( stderr, "Name return\n" ); (void)fflush(stderr); \
}
#define DEBUG_OTHER(Name,Other) \
if (Dragon_Resources.Debug) { \
(void)fprintf( stderr, "Name Other\n" ); (void)fflush(stderr); \
}
#define DEBUG_ERROR(Test,Msg) \
if (Test) { (void)fprintf(stderr,Msg); (void)fflush(stderr); }
#else
#define DEBUG_CALL(Name)
#define DEBUG_RETURN(Name)
#define DEBUG_OTHER(Name,Other)
#define DEBUG_ERROR(Test,Msg)
#endif /* WANTDEBUG */
/******************************************************************************
* Bitmap/Image Initialization Structure
******************************************************************************/
typedef struct _XImage_Init {
XImage *image;
char *bits;
int width;
int height;
} XImage_Init;
\f
/******************************************************************************
* Global State
******************************************************************************/
typedef enum { s_Normal, s_Sample } Display_State;
VARI( Display_State Board_State, s_Normal );
VAR( Dragon_Resources_Rec Dragon_Resources ); /* Application resources */
VAR( Widget Dragon ); /* The top level widget */
VAR( Widget Board ); /* Our main drawable */
VAR( String Program_Name ); /* Name of program in cmd */
VAR( int Tile_Control ); /* Control bits */
#define SHADOW (1<<0)
#define BLACKSIDE (1<<1)
#define GRAYSIDE (1<<2)
VAR( GC Gray_GC ); /* fg=blk, bg=wht, fcn=copy */
VAR( GC Normal_GC ); /* fg=blk, bg=wht, fcn=copy */
VAR( GC Over_GC ); /* fg=blk, bg=wht, fcn=or */
VAR( GC Reverse_GC ); /* fg=wht, bg=blk, fcn=copy */
VAR( GC Xor_GC ); /* fg=blk, bg=wht, fcn=xor */
#undef VAR
#undef VARI