BRL-CAD
dm-pex.h
Go to the documentation of this file.
1 /* D M - P E X . H
2  * BRL-CAD
3  *
4  * Copyright (c) 1993-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 /** @addtogroup libdm */
22 /** @{ */
23 /** @file dm-pex.h
24  *
25  */
26 
27 #ifndef DM_PEX_H
28 #define DM_PEX_H
29 
30 #include "common.h"
31 
32 /*
33  * Display coordinate conversion:
34  * GED is using -2048..+2048,
35  * X is 0..width, 0..height
36  */
37 #define GED_TO_Xx(_dmp, x) ((int)(((x)/4096.0+0.5)*((struct pex_vars *)((_dmp)->dmr_vars))->width))
38 #define GED_TO_Xy(_dmp, x) ((int)((0.5-(x)/4096.0)*((struct pex_vars *)((_dmp)->dmr_vars))->height))
39 #define Xx_TO_GED(_dmp, x) ((int)(((x)/(double)((struct pex_vars *)((_dmp)->dmr_vars))->width - 0.5) * 4095))
40 #define Xy_TO_GED(_dmp, x) ((int)((0.5 - (x)/(double)((struct pex_vars *)((_dmp)->dmr_vars))->height) * 4095))
41 
42 #define TRY_DEPTHCUE 0
43 #define Pex_MV_O(_m) offsetof(struct modifiable_pex_vars, _m)
44 
46 #if TRY_DEPTHCUE
47  int cue;
48 #endif
51 };
52 
53 struct pex_vars {
54  struct bu_list l;
58  int width;
59  int height;
60  int omx, omy;
61  unsigned int mb_mask;
63  XFontStruct *fontstruct;
64  GC gc;
65 #ifdef DOUBLE_BUFFERING_WITH_PIXMAPS
66  Pixmap pix;
67  int pix_width, pix_height;
68 #endif
69  PEXRenderer renderer;
70  PEXRendererAttributes rattrs;
72  unsigned long black, gray, white, yellow, red, blue;
73  unsigned long bd, bg, fg; /* color of border, background, foreground */
75 };
76 
78 
79 extern void Pex_configure_window_shape();
80 extern void Pex_establish_perspective();
81 extern void Pex_set_perspective();
82 extern struct pex_vars head_pex_vars;
83 
85 
86 #endif /* DM_PEX_H */
87 
88 /** @} */
89 /*
90  * Local Variables:
91  * mode: C
92  * tab-width: 8
93  * indent-tabs-mode: t
94  * c-file-style: "stroustrup"
95  * End:
96  * ex: shiftwidth=4 tabstop=8
97  */
int dummy_perspective
Definition: dm-pex.h:50
int width
Definition: dm-pex.h:58
int height
Definition: dm-pex.h:59
XFontStruct * fontstruct
Definition: dm-pex.h:63
Definition: list.h:118
struct modifiable_pex_vars mvars
Definition: dm-pex.h:74
void Pex_configure_window_shape()
unsigned long black
Definition: dm-pex.h:72
unsigned long yellow
Definition: dm-pex.h:72
unsigned long fg
Definition: dm-pex.h:73
unsigned long blue
Definition: dm-pex.h:72
long Display
Definition: dm_xvars.h:49
Header file for the BRL-CAD common definitions.
unsigned long bd
Definition: dm-pex.h:73
unsigned long white
Definition: dm-pex.h:72
struct pex_vars head_pex_vars
GC gc
Definition: dm-pex.h:64
struct bu_list l
Definition: dm-pex.h:54
void Pex_establish_perspective()
unsigned long bg
Definition: dm-pex.h:73
#define __BEGIN_DECLS
Definition: common.h:73
Tk_Window xtkwin
Definition: dm-pex.h:57
Window win
Definition: dm-pex.h:56
long Window
Definition: dm_xvars.h:50
Display * dpy
Definition: dm-pex.h:55
PEXRendererAttributes rattrs
Definition: dm-pex.h:70
unsigned long gray
Definition: dm-pex.h:72
int perspective_mode
Definition: dm-pex.h:49
void * Tk_Window
Definition: dm_xvars.h:44
int is_monochrome
Definition: dm-pex.h:71
int omx
Definition: dm-pex.h:60
void Pex_set_perspective()
int perspective_angle
Definition: dm-pex.h:62
#define __END_DECLS
Definition: common.h:74
unsigned long red
Definition: dm-pex.h:72
PEXRenderer renderer
Definition: dm-pex.h:69
int omy
Definition: dm-pex.h:60
unsigned int mb_mask
Definition: dm-pex.h:61