Link with C++ linker
[oweals/cde.git] / cde / programs / dtcalc / motif.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: motif.h /main/4 1995/11/01 12:42:00 rswiston $ */
24 /*                                                                      *
25  *  motif.h                                                             *
26  *   Contains the user interface headers for the Desktop                *
27  *   Calculator.                                                        *
28  *                                                                      *
29  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
30  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
31  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
32  * (c) Copyright 1993, 1994 Novell, Inc.                                *
33  */
34
35 typedef struct Xobject {            /* Motif/Xlib graphics object. */
36   Pixmap icon, iconmask ;
37   Widget menubar, mainWin, kFrame;
38   Widget kframe, mframe[MAXMODES], rframe, frframe, Aframe, CFframe, Pframe ;
39   Widget textForm, textFrame;
40   Widget kbuttons[BROWS][BCOLS];
41   Widget Apanel, Api_butOK, Api_butClose, Api_butHelp ;
42   Widget kkeyboard, kpanel, modeline, modeFrame, notice ;
43   Widget menus[MAXMENUS], modevals[MAXITEMS], registers[MAXREGS];
44   Widget fregisters[FINREGS], fregistersvals[FINREGS];
45   Widget Papply, Pdefaults, Ppanel, Preset ;
46   Widget CFpanel, CFpi_butOK, CFpi_butClose, CFpi_butHelp ;
47   Widget popupMenu, asciiConv, enterFun, enterConst, Close;
48   Widget helpDialog;               /* the help dialog box .....*/
49   Widget errParent, errDialog;
50   Widget baseWidgArry[4], numWidgArry[3], ttypeWidgArry[3];
51
52   struct cW_struct *Pappearance, *Pdisplay;
53   struct tW_struct *Api_text, *CFpi_cftext, *CFpi_dtext, *CFpi_vtext ;
54
55   enum menu_type CFtype ;
56
57   Atom clipboard ;
58   Atom length_atom ;
59   Display *dpy ;                    /* Display ids of dtcalc frames. */
60   Window root ;
61
62   XtAppContext app ;
63   XEvent *event ;                   /* Current X event being processed. */
64   XrmDatabase dtcalcDB ;            /* Dtcalc resources database. */
65   XrmDatabase rDB ;                 /* Combined resources database. */
66   char *home ;                      /* Pointer to user's home directory. */
67   char *iconfont ;                  /* Font to use for icon label. */
68   char *cfval ;                     /* Constant/Function number. */
69   char *dval ;                      /* Constant/Function description. */
70   char *vval ;                      /* Constant/Function value. */
71
72   short helpMapped;
73
74 /* Data for holding information about the server's keyboard mapping. */
75
76   int kcmin ;                       /* Minimum keycode. */
77   int kcmax ;                       /* Maximum keycode. */
78   int keysyms_per_key ;             /* Keysyms per keycode. */
79   unsigned char *kparray ;          /* Array indicating if key is on keypad. */
80
81   enum menu_type mtype ;
82   int cfexists ;                    /* Constant/function already exists? */
83   int cfno ;                        /* Current constant/function number. */ 
84   int mrec[MAXMENUS] ;
85   int screen ;                      /* Default graphics display screen. */
86 } XObject ;
87
88 typedef struct Xobject *XVars ;
89
90 XVars X ;
91
92 #ifndef CDE_INSTALLATION_TOP
93 #define CDE_INSTALLATION_TOP "/usr/dt"
94 #endif
95 #define CALC_ICON_NAME     CDE_INSTALLATION_TOP "/appconfig/icons/C/Dtcalc.l.pm"
96 #define CALC_ICON_NAME_BM  CDE_INSTALLATION_TOP "/appconfig/icons/C/Dtcalc.l.bm"
97
98 #define HELP_HELP_MENU                  710
99
100 #define HELP_INTRODUCTION               711
101 #define HELP_TABLEOFCONTENTS            712
102 #define HELP_TASKS                      713
103 #define HELP_REFERENCE                  714
104 #define HELP_ITEM                       715
105 #define HELP_USING                      716
106 #define HELP_VERSION                    717
107
108 #define HELP_ASCII                      718
109 #define HELP_CONSTANT                   719
110 #define HELP_FUNCTION                   720
111
112 #define HELP_DISPLAY                    721
113 #define HELP_MODELINE                   722
114 #define HELP_MODE                       723
115 #define HELP_BASE                       724
116 #define HELP_NOTATION                   725
117 #define HELP_TRIG                       726
118 #define HELP_MENUBAR                    727
119
120 #define HELP_USING_HELP_VOLUME          "Help4Help"
121 #define HELP_VOLUME                     "Calculator"
122
123 #define HELP_HELP_MENU_STR              "helpMenu"
124 #define HELP_INTRODUCTION_STR           "_HOMETOPIC"
125 #define HELP_TABLEOFCONTENTS_STR        "TableOfContents"
126 #define HELP_TASKS_STR                  "Tasks"
127 #define HELP_REFERENCE_STR              "Reference"
128 #define HELP_ITEM_STR                   "onItem"
129 #define HELP_USING_STR                  "_HOMETOPIC"
130 #define HELP_VERSION_STR                "_COPYRIGHT"
131
132 #define HELP_ASCII_STR                  "asciiHelp"
133 #define HELP_CONSTANT_STR               "constantHelp"
134 #define HELP_FUNCTION_STR               "functionHelp"
135
136 #define HELP_DISPLAY_STR                "display"
137 #define HELP_MODELINE_STR               "modeline"
138 #define HELP_MENUBAR_STR                "popup"
139
140 #define HELP_BLANK_STR                  "blank"
141 #define HELP_ACC_STR                    "calcAccuracy"
142 #define HELP_LSHIFT_STR                 "shiftleft"
143 #define HELP_RSHIFT_STR                 "shiftright"
144 #define HELP_TRUNC16_STR                "trunc16"
145 #define HELP_TRUNC32_STR                "trunc32"
146 #define HELP_INT_STR                    "ipercentYr"
147 #define HELP_PAYPYR_STR                 "PperYR"
148 #define HELP_ETOX_STR                   "e2thex"
149 #define HELP_TENTOX_STR                 "ten2thex"
150 #define HELP_YTOX_STR                   "y2thex"
151 #define HELP_XFACT_STR                  "xfactorial"
152 #define HELP_RECIP_STR                  "reciprocalx"
153 #define HELP_SQUARE_STR                 "xsquared"
154 #define HELP_SQRT_STR                   "calcSqrt" 
155 #define HELP_PERCENT_STR                "calcpercent"
156 #define HELP_LPAREN_STR                 "leftparen"
157 #define HELP_RPAREN_STR                 "rightparen"
158 #define HELP_CHGSIGN_STR                "plusorminus"
159 #define HELP_TIMES_STR                  "times"
160 #define HELP_SEVEN_STR                  "seven"
161 #define HELP_EIGHT_STR                  "eight"
162 #define HELP_NINE_STR                   "nine"
163 #define HELP_DIVIDE_STR                 "calcdivide"
164 #define HELP_FOUR_STR                   "four"
165 #define HELP_FIVE_STR                   "five"
166 #define HELP_SIX_STR                    "six"
167 #define HELP_MINUS_STR                  "minus"
168 #define HELP_ONE_STR                    "one"
169 #define HELP_TWO_STR                    "two"
170 #define HELP_THREE_STR                  "three"
171 #define HELP_PLUS_STR                   "plus"
172 #define HELP_ZERO_STR                   "zero"
173 #define HELP_DECIMAL_STR                "period"
174 #define HELP_EQUAL_STR                  "equal"
175
176 #define NORMAL_RESTORE  0
177 #define HOME_RESTORE    1
178 #define CURRENT_RESTORE    2
179
180 #define MAX_PATH 1024