UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ymprog.h
1 
2 #ifndef _YMPROG_H
3 #define _YMPROG_H
4 /* @(#)Ymprog.h */
5 /************************************************************************
6 *************************************************************************
7 **
8 ** FILE NAME: Ymprog.h
9 **
10 ** PURPOSE: Initializes Menu the DEC widget toolkit and creates the
11 ** main user interface.
12 **
13 ** CONTENTS:
14 ** typedefs: Ymenu;
15  Ycb;
16  Menu_struct;
17 ** FUNCTIONS: ....
18 **
19 ** AUTHOR: Kovanova Irina
20 ** Pankratov Alexey & Sveta
21 ** DATE: ?? Noveber 1992
22 **
23 *************************************************************************
24 *************************************************************************
25 */
26 
27 #ifndef __N_XG_DEF_H_
28 #include "xg_def.h"
29 #endif /*__N_XG_DEF_H_*/
30 
31 #include <string.h>
32 #include <X11/Xlib.h>
33 #include <X11/Intrinsic.h>
34 #include <X11/Shell.h>
35 
36 #include <Xm/Xm.h>
37 /* For all widgets used you must include their public .h file*/
38 #include <Xm/RowColumn.h> /* Menu widget public file */
39 #include <Xm/MainW.h> /* Main Window widget public file */
40 #include <Xm/PushB.h> /* Push button widget public file */
41 #include <Xm/CascadeB.h> /* Cascade button widget public file */
42 #include <Xm/Frame.h>
43 
44 #ifdef RISC_6000
45 typedef unsigned short s_char;
46 #define Y_XmTextSetCursorPosition(a,b) _XmTextSetCursorPosition(a,b,NULL)
47 #else
48 typedef char s_char;
49 #define Y_XmTextSetCursorPosition(a,b) _XmTextSetCursorPosition(a,b)
50 #endif /*RISC_6000*/
51 
52 /********************** DEFINES ****************************************/
53 #ifndef MEMCPDEF
54 #define MEMCPDEF
55 #define memcpy_(a,b,c) memcpy((char *)(a),(char *)(b),c)
56 #define memcmp_(a,b,c) memcmp((char *)(a),(char *)(b),c)
57 #define memset_(a,b,c) memset((char *)(a),b,c)
58 #endif
59 #ifndef MIN_MAX_
60 #define MIN_MAX_
61 #define MIN_(x,a) if(x > (a)) x = a
62 #define MAX_(x,a) if(x < (a)) x = a
63 #define Swap(x,y) (x ^= (y ^= (x ^= y)))
64 #define FtoI(a) ((a < 0) ? a-0.5 : a+0.5)
65 #define Zabs(a) ((a < 0) ? -a : a)
66 #define Sign(a) ((a < 0) ? -1 : 1)
67 #define max(a,b) (((a) > (b)) ? (a) : (b))
68 #define min(a,b) (((a) < (b)) ? (a) : (b))
69 #endif
70 /*#endif*/ /*MINMAX*/
71 
72 #define GetOut(wd) (((XmTextWidget) (wd))->text.output)
73 #define GetInp(wd) (((XmTextWidget) (wd))->text.input)
74 #define GetSource(wd) (((XmTextWidget) (wd))->text.source)
75 #define GetPart(wd) (((XmTextWidget) (wd))->text)
76 #define GetCurs(wd) (((XmTextWidget) (wd))->text).cursor_position
77 #define GetCurF(wd) (((XmTextWidget) (wd))->text).first_position
78 #define GetCurL(wd) (((XmTextWidget) (wd))->text).last_position
79 #define GetPrim(wd) (((XmTextWidget) (wd))->primitive)
80 #define GetUser(wd) (((XmTextWidget) (wd))->primitive).user_data
81 #define GetUserT(wd) (((XmTextWidget) (wd))->primitive).user_data
82 #define GetUserB(wd) (((XmPushButtonWidget) (wd))->primitive).user_data
83 #define GetUserD(wd) (((XmDrawingAreaRec*)(wd))->manager).user_data
84 /*#define GetData(wd) (((OutputData) (GetOut(wd)))->data)*/
85 #define GetFrameF(wd) (((XmFrameWidget) (wd))->manager).foreground
86 #define GetFrameGCb(wd) (((XmFrameWidget) (wd))->manager).background_GC
87 
88 #define XtAddCallback_(a,b,c,d) XtAddCallback((Widget)a,b,(XtCallbackProc)(c),(XtPointer)(d))
89 #define YtSetTranslation_(a,b,c,d) YtSetTranslation((Widget)(a),b,c,(XtActionProc)(d))
90 
91 #define YtCoreClassPart(w) ((CoreClassPart*)(w)->core.widget_class)
92 #define YtRealezeProc(w) YtCoreClassPart(w)->realize
93 #define YtExposeProc(w) YtCoreClassPart(w)->expose
94 
95 #define GetWidgetX(w) (w)->core.x
96 #define GetWidgetY(w) (w)->core.y
97 
98 #define GetWidgetWidth(w) (w)->core.width
99 #define GetWidgetHeight(w) (w)->core.height
100 
101 typedef struct {
102  Widget wl,wt,wr,wb;
103  short sl,st,sr,sb;
104 } ATTACH_OBJ;
105 
106 /***********************************************************************/
107 
108 #define YtSetArg(name, d) YtSetArg_(name,(XtArgVal)(d))
109 #define YtSetArg0(name, d) YtSetArg0_(name,(XtArgVal)(d))
110 
111 #define YmDefault -1
112 #define YmWork 0
113 #define YmMenu 1
114 #define YmControl 2
115 #define YmDraw 3
116 #define YmMessage 4
117 #define YmSFrame 5
118 #define YmQButton 6
119 #define YmCButton 7
120 #define YmSButton1 8
121 #define YmSButton2 9
122 #define YmNormText 10
123 #define YmTitleText 11
124 #define YmHiText 12
125 #define YmSelectText 13
126 #define YmHiSelectText 14
127 #define YmSlider 15
128 #define Nnames 16
129 
130 #define NFrameRes (YmSFrame-YmWork+1)
131 #define NButtonRes (YmSButton2-YmQButton+1)
132 #define NTextRes (YmHiSelectText-YmNormText+1)
133 #define NSliderRes 1
134 
135 typedef struct
136 {
137  XmStringCharSet L_charset;
138  XmStringCharSet A_charset;
139 } Menu_struct;
140 
141 
142 #if 0
143 /* --> see YRes.c */
144 /* Максимальное количество ресурсов. */
145 #define TEXT_Narg 4
146 #define FRAME_Narg 5+1
147 #define BUTTON_Narg 10
148 #define SLIDER_Narg 3
149 #endif
150 
151 /* Суммарноемаксимальное количество ресурсов. */ #define N_Narg 30 /* Поддерживаемое число экранов - до 4-х */ #define Screen_N 4 /* Список ресурсов для каждого объекта (Text, Button, Slider, Frame) */ typedef struct { short i, n; Arg arg[N_Narg]; } Yres; /* Список указателей на списки ресурсов различных объектов для всех экранов */ typedef struct { int n; Yres *res[Nnames*Screen_N]; } YResource; /* Глобальный список ресурсов. */ extern YResource YResources; /* Макрос для создания локальной переменной a - списка ресурсов указанной емкости b. */ #define StructYres(a,b) struct {short i,n; Arg arg[b];} a; a.i = 0; a.n = b; /* Тип обработчика событий в SDSTOOL. */ typedef int (*CallB)(int); /* Тип процедуры специального изображения переменной в SDSTOOL. */ typedef void (*PrnText)(); /* #define YFrame_ 0x0100 #define YMnstr_ 0x0200 #define YText_ 0x0400 #define YTextW_ 0x0500 #define YButton_ 0x0800 #define YLabel_ 0x1000 #define YDraw_ 0x2000 #define YScrollBar_ 0x4000 #define YScale_ 0x5000 #define YSeparator_ 0x8000 */ #define YAddType_ 0x000000ff #define YType_ 0x0000ff00 #define dLURD 0x000f0000 #define dLURD_ 0x00f00000 #define MnstrType(a_) ((a_) & YType_) /********************** DEFINES STRUCT ********************************/ #define dLeft 0x00010000 #define dLt dLeft #define dUp 0x00020000 #define dRight 0x00040000 #define dRt dRight #define dDown 0x00080000 #define dDn dDown #define dDnLt 0x00090000 #define dDnRt 0x000c0000 #define dRtDn 0x000c0000 #define dDnLtRt 0x000d0000 #define dUpLtRt 0x00070000 #define dDnUp 0x000a0000 #define dLtRt 0x00050000 #define dRtLt 0x00050000 #define dLeft_ 0x00100000 #define dUp_ 0x00200000 #define dRight_ 0x00400000 #define dDown_ 0x00800000 #define dDownF 0x00800000 #define dBottom (dDown | dLeft_) #define dAttach_ 0x00ff0000 #define dIOEvent 0x01000000 #define dScreen 0x02000000 #define dUnSensitive 0x04000000 #define dArmed 0x08000000 #define dUnmap 0x10000000 #define dUnvisible 0x10000000 #define dUserRes 0x20000000 #define dTitle 0x40000000 #define dTear 0x40000000 #define dHelp 0x80000000 #define dSouth dDown #define dNorth dUp #define dWest dLeft #define dEast dRight /*----------------------------------------------------------------------*/ #define dList 0x0001 #define dBeginning 0x0002 #define dForm 0x0004 #define dRowCol 0x0008 #define dScrWin 0x0010 #define dMenuBar 0x0020 #define dPopMenu 0x0040 #define YFrameMB_ 0x0120 #define YFrame_ 0x0100 #define YFrameR_ 0x0108 #define YFrameL_ 0x0101 #define YFrame_R (YFrame_ | dRight) #define YFrameR_R (YFrameR_ | dRight) #define YFrame_D (YFrame_ | dDown) #define YFrameR_D (YFrameR_ | dDown) #define YFrame_RD (YFrame_ | dDown | dRight) #define YFrameR_RD (YFrameR_ | dDown | dRight) #define YFrame_DR (YFrame_ | dDown | dRight) #define YFrameR_DR (YFrameR_ | dDown | dRight) #define YFrame_LR (YFrame_ | dLeft | dRight) #define YFrameR_RL (YFrameR_ | dLeft | dRight) #define YFrame_RL (YFrame_ | dLeft | dRight) #define YFrameR_LR (YFrameR_ | dLeft | dRight) #define YFrame_U (YFrame_ | dUp) #define YFrameR_U (YFrameR_ | dUp) #define YFrame_B (YFrame_ | dBeginning) #define YFrameR_B (YFrameR_ | dBeginning) #define YFrame_RB (YFrame_ | dRight | dBeginning) #define YFrameR_RB (YFrameR_ | dRight | dBeginning) #define YFrame_DB (YFrame_ | dDown | dBeginning) #define YFrameR_DB (YFrameR_ | dDown | dBeginning) #define YFrame_UB (YFrame_ | dUp | dBeginning) #define YFrameR_UB (YFrameR_ | dUp | dBeginning) /*----------------------------------------------------------------------*/ #define YMnstr_ 0x0200 #define dMenuShell 0x0004 /* MenuShell */ #define dFDialog 0x0001 /* resizable Form Dialog */ #define dBBDialog 0x0002 /* Bulletin Board Dialog */ #define dSDialog 0x0003 /* Shell Dialog */ #define dDialog 0x0007 #define dModal 0x0008 /* 31.10.2000 Modal popup window */ #define YMnstrD_ 0x0201 #define YMnstrSD_ 0x0203 #define YMnstrDS_ 0x0203 #define dNoResize 0x0080 #define dIcon 0x0040 /*#define dScrWin 0x0010*/ /*----------------------------------------------------------------------*/ #define YText_ 0x0400 #define dInt 0x0001 #define dFloat 0x0002 #define dChar 0x0004 #define dVal 0x0003 #define dScale 0x0008 #define dUnmapS 0x0080 #define dScaleU 0x0088 #define dScaleUnmap 0x0088 #define dSscaleUp_ 0x0020 #define dScaleUp 0x0028 #define dInp 0x0010 #define dFirst 0x02000000 #define dNoInverse 0x0040 #define YTextI_ 0x0401 #define YTextC_ 0x0404 #define YTextF_ 0x0402 #define YTextIS_ 0x0409 #define YTextFS_ 0x040a #define YText_R ( YText_ | dRight) #define YText_L ( YText_ | dLeft) #define YTextC_D ( YTextC_ | dDown ) #define YTextC_DR ( YTextC_ | dRight | dDown) #define YTextC_RD ( YTextC_ | dRight | dDown) #define YTextC_LR ( YTextC_ | dRight | dLeft) #define YTextC_RL ( YTextC_ | dRight | dLeft) #define YTextFU_ ( YTextF_ | dUserRes) #define YTextIU_ ( YTextI_ | dUserRes) #define YTextCU_ ( YTextC_ | dUserRes) #define YTextI_DR ( YTextI_ | dRight | dDown) #define YTextI_RD ( YTextI_ | dRight | dDown) #define YTextI_R ( YTextI_ | dRight) #define YTextI_L ( YTextI_ | dLeft) #define YTextI_LD ( YTextI_ | dLeft | dDown) #define YTextI_LR ( YTextI_ | dRight | dLeft) #define YTextI_RL ( YTextI_ | dRight | dLeft) #define YTextI_LRD ( YTextI_ | dRight | dDown | dLeft) #define YTextI_LDR ( YTextI_ | dRight | dDown | dLeft) #define YTextI_DLR ( YTextI_ | dRight | dDown | dLeft) #define YTextI_DRL ( YTextI_ | dRight | dDown | dLeft) #define YTextI_RDL ( YTextI_ | dRight | dDown | dLeft) #define YTextI_RLD ( YTextI_ | dRight | dDown | dLeft) #define YTextF_DR ( YTextF_ | dRight | dDown) #define YTextF_RD ( YTextF_ | dRight | dDown) #define YTextF_R ( YTextF_ | dRight) #define YTextF_L ( YTextF_ | dLeft) #define YTextF_LD ( YTextF_ | dLeft | dDown) #define YTextF_LR ( YTextF_ | dRight | dLeft) #define YTextF_RL ( YTextF_ | dRight | dLeft) #define YTextF_LRD ( YTextF_ | dRight | dDown | dLeft) #define YTextF_LDR ( YTextF_ | dRight | dDown | dLeft) #define YTextF_DLR ( YTextF_ | dRight | dDown | dLeft) #define YTextF_DRL ( YTextF_ | dRight | dDown | dLeft) #define YTextF_RDL ( YTextF_ | dRight | dDown | dLeft) #define YTextF_RLD ( YTextF_ | dRight | dDown | dLeft) /*----------------------------------------------------------------------*/ #define YTextW_ 0x0500 #define dScrH 0x0001 #define dScrV 0x0002 #define TextBackward 1 #define TextForward 0 /*----------------------------------------------------------------------*/ /*#define dArmed 0x08000000 Armed ToggelButton */ #define dALeft 0x10 #define dARight 0x20 #define dAUp 0x40 #define dADown 0x80 #define dArrowB 0xf0 #define dToggle 0x0004 #define dDrawn 0x0008 #define dCascade 0x0002 #define YButton_ 0x0800 #define YButtonT_ 0x0804 #define YButtonD_ 0x0808 #define YButtonC_ 0x0802 #define YButtonC_R (YButtonC_ | dRight) #define YButton_R (YButton_ | dRight) #define YButton_D (YButton_ | dDown) #define YButton_L (YButton_ | dLeft) #define YButton_RD (YButton_ | dRight | dDown) #define YButton_LD (YButton_ | dLeft | dDown) #define YButton_DL (YButton_ | dLeft | dDown) #define YButton_LDR (YButton_ | dLeft | dDown | dRight) #define YButton_DLR (YButton_ | dLeft | dDown | dRight) #define YButtonT_R (YButtonT_ | dRight) #define YButtonK YButton #define YButtonK_ YButton_ #define YButtonKT_ YButtonT_ #define YButtonTK_ YButtonT_ /*----------------------------------------------------------------------*/ #define YLabel_ 0x1000 #define YLabel_R (YLabel_ | dRight) #define YLabel_L (YLabel_ | dLeft) #define YLabel_D (YLabel_ | dDown) #define YLabel_U (YLabel_ | dUp) #define YLabel_RL (YLabel_ | dRight | dLeft) #define YLabel_LR (YLabel_ | dRight | dLeft) #define YLabel_DL (YLabel_ | dDown | dLeft) #define YLabel_RD (YLabel_ | dDown | dRight) #define YLabel_LD (YLabel_ | dDown | dLeft) #define YLabel_LDR (YLabel_ | dDown | dLeft | dRight) #define YLabel_DLR (YLabel_ | dDown | dLeft | dRight) /*----------------------------------------------------------------------*/ #define dHor_ 0x0001 #define dVer_ 0x0002 #define dHor 0x0001 #define dVer 0x0002 #define dPixmap_ 0x0004 #define dImage_ 0x0008 /*#define dDrawInP_ 0x0010*/ #define YDraw_ 0x2000 #define YDrawV_ 0x2002 #define YDrawH_ 0x2001 #define YDrawVH_ 0x2003 #define YDrawHV_ 0x2003 #define YDraw_P 0x2004 #define YDrawV_P 0x2006 #define YDrawH_P 0x2005 #define YDrawVH_P 0x2007 #define YDrawHV_P 0x2007 #define YDraw_I (0x2000 | dImage_) #define YDrawV_I (0x2002 | dImage_) #define YDrawH_I (0x2001 | dImage_) #define YDrawVH_I (0x2003 | dImage_) #define YDrawHV_I (0x2003 | dImage_) #define YDraw_PI (0x2004 | dImage_) #define YDrawV_PI (0x2006 | dImage_) #define YDrawH_PI (0x2005 | dImage_) #define YDrawVH_PI (0x2007 | dImage_) #define YDrawHV_PI (0x2007 | dImage_) /*----------------------------------------------------------------------*/ #define dShowValue 0x0004 #define YScale_ 0x5000 #define YScaleU_ (YScale_ | dUserRes) #define YScaleH_ (YScale_ | dHor) #define YScaleV_ (YScale_ | dVer) #define YScale_L (YScale_ | dLeft) #define YScaleH_L (YScale_ | dHor | dLeft) #define YScaleV_L (YScale_ | dVer | dLeft) #define YScale_R (YScale_ | dRight) #define YScaleH_R (YScale_ | dHor | dRight) #define YScaleV_R (YScale_ | dVer | dRight) #define YScale_RL (YScale_ | dRight | dLeft) #define YScaleH_RL (YScale_ | dHor | dRight | dLeft) #define YScaleV_RL (YScale_ | dVer | dRight | dLeft) #define YScale_D (YScale_ | dDown) #define YScaleH_D (YScale_ | dHor | dDown) #define YScaleV_D (YScale_ | dVer | dDown) /*----------------------------------------------------------------------*/ #define dArrow 0x04 #define dDrawSB_ 0x08 #define YScrollBar_ 0x4000 #define YScrollBarH_ (YScrollBar_ | dHor) #define YScrollBarV_ (YScrollBar_ | dVer) #define YScrollBar_L (YScrollBar_ | dLeft) #define YScrollBarH_L (YScrollBar_ | dHor | dLeft) #define YScrollBarV_L (YScrollBar_ | dVer | dLeft) #define YScrollBar_R (YScrollBar_ | dRight) #define YScrollBarH_R (YScrollBar_ | dHor | dRight) #define YScrollBarV_R (YScrollBar_ | dVer | dRight) #define YScrollBar_RL (YScrollBar_ | dRight | dLeft) #define YScrollBarH_RL (YScrollBar_ | dHor | dRight | dLeft) #define YScrollBarV_RL (YScrollBar_ | dVer | dRight | dLeft) #define YScrollBar_D (YScrollBar_ | dDown) #define YScrollBarH_D (YScrollBar_ | dHor | dDown) #define YScrollBarV_D (YScrollBar_ | dVer | dDown) /*----------------------------------------------------------------------*/ #define YSeparator_ 0x8000 #define YSeparatorH_ (YSeparator_ | dHor) #define YSeparatorV_ (YSeparator_ | dVer) #define YSeparator_L (YSeparator_ | dLeft) #define YSeparatorH_L (YSeparator_ | dHor | dLeft) #define YSeparatorV_L (YSeparator_ | dVer | dLeft) #define YSeparator_R (YSeparator_ | dRight) #define YSeparatorH_R (YSeparator_ | dHor | dRight) #define YSeparatorV_R (YSeparator_ | dVer | dRight) #define YSeparator_RL (YSeparator_ | dRight | dLeft) #define YSeparatorH_RL (YSeparator_ | dHor | dRight | dLeft) #define YSeparatorV_RL (YSeparator_ | dVer | dRight | dLeft) #define YSeparator_D (YSeparator_ | dDown) #define YSeparatorH_D (YSeparator_ | dHor | dDown) #define YSeparatorV_D (YSeparator_ | dVer | dDown) /*----------------------------------------------------------------------*/ #define YActivate 0x4001 #define YLoose 0x4002 #define YArm 0x4003 #define YEnter 0x4004 #define YDisArm 0x4005 #define YFocus 0x4006 #define YMove 0x4007 #define YSelect 0x4008 #define YExpose 0x4009 #define YInput 0x400a #define YResize 0x400b #define YClick 0x400c #define YChanged 0x400d #define YEsc 0x400e #define YCancel 0x400e #define YZoom 0x400f #define YOk 0x4010 #define YApply 0x4011 #define YHelp 0x4012 #define YInitZoom 0x4013 #define YTimeOut 0x4014 #define YClient 0x4015 #define YNewClient 0x4016 #define YKillClient 0x4017 #define YResizeR 0x4018 #define YModify 0x4019 #define YRefresh 0x401a #define YCreate 0x401b #define YPrimLoose 0x401c #define YPrimFocus 0x401d #define YDragScale 0x401e #define YCopy 0x401f #define YXorExpose 0x4020 #define YLoad 0x4021 #define YSave 0x4022 #define YDrag 0x4023 #define YIncrementV 0x01 #define YDecrementV 0x02 #define YChangedV 0x03 #define YDragV 0x04 #define YIncrementH 0x11 #define YDecrementH 0x12 #define YChangedH 0x13 #define YDragH 0x14 /*----------------------------------------------------------------------------*/ typedef struct { unsigned char* data_name; /* data or filename for icon */ char* icon_name; short icon_file, icon_depth; short icon_width,icon_height; Pixmap icon_pixmap; int icon_count; } YIcon; typedef struct { YIcon Icon; int fg,count; Window win; GC gc; } YIconTitle; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget */ } YUnion; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget */ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ } YButton; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget */ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ short n; void** T; } YButtonC; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; int slider_size; int increment; int page_increment; void* user; } YScrollBar; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; short thickness,length; int increment; int decimalPoints; void* user; } YScale; typedef YScrollBar YmScrollBarValues; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short width; short height; char* fontname; GC gc; void* usr; Window win; XFontStruct* font; short ch_w, ch_h; short x,y; int x_root, y_root; /* coordinates relative to root */ unsigned int eType, keycode; /* detail */ int foreground, background; /*signed */char mode,clip,WinDraw,CgmDraw; YScrollBar Vs; YScrollBar Hs; XEvent* Draw_event; Pixmap pixmap; XImage* image; int cyrsor_type; Cursor cursor; short x1, y1, w1, h1; /* Clip box */ short count,key; /* Not use it */ void* vol; /* Not use it */ int CgmWidth,CgmHeight,CgmX,CgmY; int ScreenId; /* !vlad! */ } YDraw; typedef struct { int type; char* name; short res; Widget w; /* return creating widget*/ YIcon* I; /* structure for icon */ } YLabel; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; } YText; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short rows,columns; short c_row,c_col; char* buf; } YTextW; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; short maxlen; char* value; } YTextC; #define YTextS YTextC typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; } YTextI; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; } YTextF; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; } YFrame; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; short row; } YFrameR; typedef struct { int type; char* name; short res; short thickness,width,height; Widget w; } YSeparator; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** F; YIcon* I; /* structure for icon */ Widget form; } YMnstr; /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ Arg* args; } YrButton; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ Arg* args; short n; void** T; } YrButtonC; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; int slider_size; int increment; int page_increment; void* user; Arg* args; } YrScrollBar; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; short thickness,length; int increment; int decimalPoints; void* user; Arg* args; } YrScale; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short width; short height; char* fontname; GC gc; void* usr; Window win; XFontStruct* font; short ch_w, ch_h; short x,y; int x_root, y_root; /* coordinates relative to root */ unsigned int eType, keycode; /* detail */ int foreground, background; char mode,clip,WinDraw,PixmapDraw; YScrollBar Vs; YScrollBar Hs; XEvent* Draw_event; Pixmap pixmap; XImage* image; int cyrsor_type; Cursor cursor; short x1, y1, w1, h1; /* Clip box */ short count,key; /* Not use it */ void* vol; /* Not use it */ int CgmWidth,CgmHeight,CgmX,CgmY; Arg* args; } YrDraw; typedef struct { int type; char* name; short res; Widget w; /* return creating widget*/ YIcon* I; /* structure for icon */ Arg* args; } YrLabel; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; Arg* args; } YrText; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short rows,columns; short c_row,c_col; char* buf; Arg* args; } YrTextW; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; short maxlen; char* value; Arg* args; } YrTextC; #define YrTextS YrTextC typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; Arg* args; } YrTextI; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; Arg* args; } YrTextF; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; Arg* args; } YrFrame; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; short row; Arg* args; } YrFrameR; typedef struct { int type; char* name; short res; short thickness,width,height; Widget w; Arg* args; } YrSeparator; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** F; YIcon* I; /* structure for icon */ Widget form; Arg* args; } YrMnstr; typedef union { int type; YUnion Un; YText Text; YTextS TextS; YTextI TextI; YTextF TextF; YTextW TextW; YButton Button; YButtonC ButtonC; YLabel Label; YFrame Frame; YFrameR FrameR; YDraw Draw; YScrollBar ScrollBar; YScale Scale; YSeparator Separator; YMnstr Mnstr; YrText rText; YrTextS rTextS; YrTextI rTextI; YrTextF rTextF; YrTextW rTextW; YrButton rButton; YrButtonC rButtonC; YrLabel rLabel; YrFrame rFrame; YrFrameR rFrameR; YrDraw rDraw; YrScrollBar rScrollBar; YrScale rScale; YrSeparator rSeparator; YrMnstr rMnstr; } YType; #define DLabel(var, type,name,res, Ic) \ YLabel var = {YLabel_|type,name,res,0,Ic} #define DrLabel(var, type,name,res, Ic,args) \ YrLabel var = {YLabel_|dUserRes|type,name,res,0,Ic,args} #define DTextF(var, type,name,res,cb, len,P,value,minv,maxv) \ YTextF var = {YTextF_|type,name,res,cb,0,len,P,value,minv,maxv} #define DrTextF(var, type,name,res,cb, len,P,value,minv,maxv, args) \ YrTextF var = {YTextFU_|type,name,res,cb,0,len,P,value,minv,maxv,0,args} #define DTextC( var, type,name,res,cb, len,maxlen,value) \ YTextC var = {YTextC_|type,name,res,cb,0,len,maxlen,value} #define DrTextC(var, type,name,res,cb, len,maxlen,value,args) \ YrTextC var = {YTextCU_|type,name,res,cb,0,len,maxlen,value,args} #define DTextI(var, type,name,res,cb, len,P,value,minv,maxv) \ YTextI var = {YTextI_|type,name,res,cb,0,len,P,value,minv,maxv} #define DrTextI(var, type,name,res,cb, len,P,value,minv,maxv, args) \ YrTextI var = {YTextIU_|type,name,res,cb,0,len,P,value,minv,maxv,0,args} #define DText(var, type,name,res,cb, len) \ YText var = {YText_|type,name,res,cb,0,len} #define DrText(var, type,name,res,cb, len,args) \ YrText var = {YText_|dUserRes|type,name,res,cb,0,len,args} #define DrScale(var, type,name,res,cb, val,mi,ma,thck,len,incr,d,args) \ YrScale var = {YScaleU_|type,name,res,cb,0,val,mi,ma,thck,len,incr,d,args} #define DScale(var, type,name,res,cb, val,mi,ma,thck,len,incr,d) \ YScale var = {YScale_|type,name,res,cb,0,val,mi,ma,thck,len,incr,d} #define DButton(var, type,name,res,cb, kIn,kOut,Ic) \ YButton var = {YButton_|type,name,res,cb,0,kIn,kOut,Ic} #define DrButton(var, type,name,res,cb, kIn,kOut,Ic,args) \ YButton var = {YButton_|type,name,res,cb,0,kIn,kOut,Ic,args} #define DButtonT(var, type,name,res,cb, kIn,kOut,Ic) \ YButton var = {YButtonT_|type,name,res,cb,0,kIn,kOut,Ic} #define DrButtonT(var, type,name,res,cb, kIn,kOut,Ic,args) \ YButton var = {YButtonT_|type,name,res,cb,0,kIn,kOut,Ic,args} #define DButtonC(var, type,name,res,cb, kIn,kOut,Ic,n,T) \ YButtonC var = {YButtonC_|type,name,res,cb,0,kIn,kOut,Ic,n,T} #define DrButtonC(var, type,name,res,cb, kIn,kOut,Ic,args,n,T) \ YrButtonC var = {YButtonC_|dUserRes|type,name,res,cb,0,kIn,kOut,Ic,args,n,T} #define DMnstrD(var, type,name,res,n, F,I) \ YMnstr var = {YMnstrD_|type,name,res,n,0,F,I} #define DrMnstrD(var, type,name,res,n, F,I, args) \ YrMnstr var = {YMnstrD_|dUserRes|type,name,res,n,0,F,I,0,args} #define DFrame(var, type,name,res,n, F) \ YFrame var = {YFrame_|type,name,res,n,0,F} #define DrFrame(var, type,name,res,n, F,args) \ YrFrame var = {YFrame_|dUserRes|type,name,res,n,0,F,args} #define DFrameR(var, type,name,res,n, F,row) \ YFrameR var = {YFrameR_|type,name,res,n,0,F,row} #define DrFrameR(var, type,name,res,n, F,row,args) \ YrFrameR var = {YFrameR_|dUserRes|type,name,res,n,0,F,row,args} #ifndef Y_UTIL #define Y_UTIL #define ClearFlag(a,f) a &= ~(f) #define SetFlag(a,f) a |= (f) #define Is(a,f) if(((a) & (f)) == (f)) #define IsNo(a,f) if(((a) & (f)) != (f)) #define IsNot(a,f) if(((a) & (f)) == 0) #define Cpy(a,b1) strcpy(a,b1) #define CpyCat(a,b1,b2) strcat(strcpy(a,b1),b2) #define CpyCatCat(a,b1,b2,b3) strcat(strcat(strcpy(a,b1),b2),b3) #define CpyCatCatCat(a,b1,b2,b3,b4) strcat(strcat(strcat(strcpy(a,b1),b2),b3),b4) #define Cat(a,b1) strcat(a,b1) #define CatCat(a,b1,b2) strcat(strcat(a,b1),b2) #define CatCatCat(a,b1,b2,b3) strcat(strcat(strcat(a,b1),b2),b3) #endif /*Y_UTIL*/ #define YmSetValueT(a,b) YmSetValue((YType*) (a),b) #define CloseMonstr(a) YmCloseMonstr_((YType*) (a)) #define YmCloseMonstr(a) YmCloseMonstr_((YType*) (a)) #define KillMonstr(a) YmKillMonstr_((YType*) (a)) #define YmKillMonstr(a) YmKillMonstr_((YType*) (a)) #define IsMonstrKilled(a) (Boolean)YtWidget((YType*)(a)) #define YtWidget(a) YtWidget_((YType*)(a)) #define YmWidget(a) YtWidget_((YType*)(a)) #define YtSetSensitive(t,b) YtSetSensitive_((YType*)(t),b) #define YtGetSensitive(t) YtGetSensitive_((YType*)(t)) #define YmSetVisible(t,b) YmSetVisible_((YType*)(t),b) #define YmGetVisible(t) YmGetVisible_((YType*)(t)) #define YmWidth(t) YmWidth_((YType*)(t)) #define YmHeight(t) YmHeight_((YType*)(t)) #define YmResizeMonstr(t,a,b) YmResizeMonstr_((YType*)(t),a,b) #define YmNOutKey(cb,n,a) YmNOutKey_(cb,n,(caddr_t)a) #define YmResizeParentMonstr(t,a,b) YmResizeParentMonstr_((YType*)(t),a,b) /********************* FORWARD DEFINES *********************************/ #ifdef _NO_PROTO_ void ChangeFileExt(); char* SetStrLen(); int Call_Back(); int YmTimeOut(); int YmNOut(); int YmNOutKey_(); int Get_Time(); int YtMalloc(); void* YtFree(); void* YuFree(); void* YFree(); void* YmStringFree(); Widget YmInitShell(); Widget YmCreateMonstr(); void YmCreateMonstrTime(); void YmKillMonstr_(); void YmCloseMonstr_(); Widget YmCreateWidget(); Widget CreateDialog(); void YmRealizeMainMonstr(); int YmResizeMonstr_(); int YmResizeParentMonstr_(); void YtJumpWidget(); int YmUpdateDisplay(); int YtUpdateFrame(); int YtSetBorderValues(); void YtJampWidget(); int YtWidth(); int YtHeight(); int YmWidth_(); int YmHeight_(); Widget YtWidget_(); int YtSetArg_ (); int YtSetArg0_(); int YtSetArgPtr(); int YtSetArgPtrVerify(); int YtCopyArgPtr(); int YtCopyArgPtrDef(); int YtDeleteArg(); void YtGetValues(); void YtSetValues(); void YtSetValuesPtr(); int YtGetValuesPtr(); int YtGetValuePtr(); XtArgVal YtGetValue(); void YtSetValue(); void YtCopyWidgetValue(); int YtFindArg(); int YtGetValueDef(); int YmSetArgDef(); int YmSetArgDefName(); int YtSetColorArgPtrDef(); int YtGetAllResource(); int YtSetResourceArg(); void YmAttach(); void YmAttachS(); void YmNilAttach(); XmString YmNlabelString (); XmString YmNacceleratorText(); char* YmSetLabelName(); XImage* YtCreateDefaultImage(); int YtWarning(char *format, ...); void YtSetTranslation(); int YtSetAction(); int YtSetAction_Num(); void PrintActions(); void PrintValue(); int YmSetValue(); void YmGetTextValue(); double SetNumberTextValue(); void YmTypeText(); int YmScrollBarGetValues(); int YmScrollBarSetValues(); int YmScrollBarSetValues_(); Boolean YmToggleButtonGetState(); int YmToggleButtonSetState(); Boolean YtGetSensitive_(); int YtSetSensitive_(); Boolean YmGetVisible_(); int YmSetVisible_(); void SetWidgetColor(); void YmSetColor(); int YmGetColor(); void YmSetColorNameRes(); void YmSetInverseColorNameRes(); void YmSendClientMessage(); Window* YtSetOutputWindows(); int YmLoadFont(); int YtLoadFont(); int YtLoadFont_(); int FreeFontStructs(); XGCValues* YmGetGCValues(); int YmDeleteFontCursor(); int YmCreateFontCursor(); void YmTextSetCursorPosition(); int YtGetWindowXY(); Window YtGetParentWindow(); void YGeometry(); void YtSetWidgetColor(); int YmButtonArmDisArm(); int AddOutputWindow(); int DelOutputWindow(); int YErrorHandler(); YType* WidgetToYType(); int YtSetInputMonstr(); void YmSendClientMessage(); void YSendEvent(); void YClientMessage(); Display* YDisplay_(); Screen* YScreen_(); Screen* YtScreen(); Window YmRootWindow_(); Window YtRootWindow(); GC YDefaultGC_(); GC YtDefaultGC(); GC ScreenDefaultGC(); Window ScreenRootWindow(); void YmChangeTextLabel (); void YmNoEditBorder (); #else /* _NO_PROTO_ */ char* SetStrLen(char* str,int len); void ChangeFileExt(char *filename,char *ext); int Call_Back(CallB cb, int key); int YmTimeOut(CallB cb,int t); int YmNOut(CallB cb,int t); int YmNOutKey_(CallB cb,int t,caddr_t key); int Get_Time(int i); int YtMalloc(void* buf, long sz); void* YtFree(void *buf); void* YuFree(void *buf); void* YFree(void *buf); void* YmStringFree(XmString buf); Widget YmInitShell(char* name,char* resname,int argc,char **argv); Widget YmCreateMonstr(Widget parent,char* dpyName,YMnstr* ms); void YmCreateMonstrTime(Widget parent,char* dpyName,YMnstr* t); void YmKillMonstr_(YType* m); void YmCloseMonstr_(YType* t); Widget YmCreateWidget(Widget parent,int parentType,YType* t); Widget CreateDialog(Widget parent,char *name); void YmRealizeMainMonstr(YMnstr* t); int YmResizeMonstr_(YType* t,int width,int height); int YmResizeParentMonstr_(YType* t,int width,int height); void YtJumpWidget(YType* t); int YmUpdateDisplay(YType* t); int YtUpdateFrame(YFrame* fr,YMnstr* mn); int YtSetBorderValues(Widget w,int shadowTyp,int shadowTh, int borderW, int highlightTh); void YtJampWidget(YType* t); int YtWidth(Widget w); int YtHeight(Widget w); int YmWidth_(YType* t); int YmHeight_(YType* t); Widget YtWidget_(YType* t); int YtSetArg_ (char* name,XtArgVal d); int YtSetArg0_(char* name,XtArgVal d); int YtSetArgPtr(Yres* res,char* name,XtArgVal value); int YtSetArgPtrVerify(Yres* res,char* name,XtArgVal value); int YtCopyArgPtr(Yres* yr1,Yres* yr2,char *name1,char *name2); int YtCopyArgPtrDef(Yres* yr1,int defname,char *name1,char *name2); int YtDeleteArg(char* name); void YtGetValues(Widget w); void YtSetValues(Widget w); void YtSetValuesPtr(Widget w,Yres* res); int YtGetValuesPtr(Widget w,Yres* res); int YtGetValuePtr(Yres* yr2,char *name,XtArgVal* val); XtArgVal YtGetValue(Widget w,char* name); void YtSetValue(Widget w, char* name, XtArgVal value); void YtCopyWidgetValue(Widget w,char* name1,char* name2); int YtFindArg(char* name1,char* name2,int nname); int YtGetValueDef(int defname,char *name,XtArgVal* val); int YmSetArgDef(YType* t); int YmSetArgDefName(int res,int OnlyColor); int YtSetColorArgPtrDef(Yres* yr,int nname); int YtGetAllResource(Widget parent); int YtSetResourceArg(int nname); void YmAttach(Widget L,Widget T,Widget R,Widget B, int sl,int st,int sr,int sb); void YmAttachS( ATTACH_OBJ *att); void YmNilAttach(void); XmString YmNlabelString (char *label,int mnemonic); XmString YmNacceleratorText(char* accel_name,char* accel_key); char* YmSetLabelName(char* name); XImage* YtCreateDefaultImage(char *bits,int width,int height); int YtWarning(char *format, ...); void YtSetTranslation( Widget w, char* app_name, char* key_sym, XtActionProc proc); int YtSetAction(Widget w,char *name,char *sym); int YtSetAction_Num(Widget w,char *name,char *sym,int i); void PrintActions(Widget w); void YmNoEditBorder (YType* t); void YmChangeTextLabel (YType* t, char* str); void PrintValue(YType* t,double val); int YmSetValue(YType* t,void* value); void YmGetTextValue(YType* t); double SetNumberTextValue(YType* t,double value); void YmTypeText(Widget w,char* str); int YmScrollBarGetValues(YScrollBar* s); int YmScrollBarSetValues(YScrollBar* s); int YmScrollBarSetValues_(YScrollBar* s, int minimum,int maximum,int value, int slider_size,int increment,int page_increment); Boolean YmToggleButtonGetState(YType* t); int YmToggleButtonSetState(YType* t,int state); Boolean YtGetSensitive_(YType* t); int YtSetSensitive_(YType* t,int state); Boolean YmGetVisible_(YType* t); int YmSetVisible_(YType* t,int b); void SetWidgetColor(Widget w, int name); void YmSetColor(YType* t, int foreground,int background); int YmGetColor(YType* t, int *foreground,int *background); void YmSetColorNameRes(YType* t, int name); void YmSetInverseColorNameRes(YType* t, int name); void YmSendClientMessage(void* data,int type,Window* win,int nn); Window* YtSetOutputWindows(char* Wname[],int n,int *nn); int YmLoadFont(YType* t,char *FontName); int YtLoadFont(Widget w,char *FontName); int YtLoadFont_(char* FontName,int dr); int FreeFontStructs(void); XGCValues* YmGetGCValues(GC gc); int YmDeleteFontCursor(YDraw* yd); int YmCreateFontCursor(YDraw* yd,int cyrsor_type); void YmTextSetCursorPosition(Widget w, XmTextPosition p); int YtGetWindowXY(Window win,int *x,int *y); Window YtGetParentWindow(Display* dpy,Window win); void YGeometry(Widget w,int type); void YtSetWidgetColor(Widget w, int fg,int bg); int YmButtonArmDisArm(YType* t); int AddOutputWindow(Window win); int DelOutputWindow(Window win); int YErrorHandler(Display* disp,XErrorEvent* er); YType* WidgetToYType(Widget w); int YtSetInputMonstr(YType* t); void YmSendClientMessage(void* data,int type,Window* win,int nn); void YSendEvent(int type,int keycode,int x,int y); Display* YDisplay_(YType* t); Screen* YScreen_(YType* t); Screen* YtScreen(Widget w); Window YmRootWindow_(YType* t); Window YtRootWindow(Widget w); Window ScreenRootWindow(Screen* scr); GC YDefaultGC_(YType* t); GC YtDefaultGC(Widget w); GC ScreenDefaultGC(Screen* scr); void YClientMessage( Widget w,char* name,Atom a, int format, EventMask mask); void YmChangeTextLabel (YType* t, char* str); void YmNoEditBorder (YType* t); #endif /* _NO_PROTO_ */ #define Screen_N 4 #define YtDisplay(w) XtDisplay(w) #define YDisplay(t) YDisplay_((YType*) t) #define YmDisplay(t) YDisplay_((YType*) t) #define YScreen(t) YScreen_((YType*) t) #define YmScreen_(t) YScreen_((YType*) t) #define YmRootWindow(t) YmRootWindow_((YType*) t) #define YDefaultGC(t) YDefaultGC_((YType*) t) #define YmDefaultGC(t) YDefaultGC_((YType*) t) /********************** External var ************************************/ extern int ScreenId; extern XtAppContext app_context; /* Application Context */ extern Display* display; extern Colormap Ycmap; extern XEvent YEvent; extern XKeyEvent* TB_event; extern char* YTextPntr; extern int YTextLength; extern Window YRootWindow; extern short YRootWidth,YRootHeight; extern int YRootForeground,YRootBackground; extern GC YRootGC; extern int YDefaultScreen; extern Menu_struct Menu_env; extern Widget Top_level; extern Widget YMenu_Bar; extern Widget ButtonW; extern YType* MnstrD; extern YDraw* Draw_s; extern XEvent* Draw_event; extern Window Draw_win; extern int Ykey; extern YScrollBar* Draw_Sc; extern char* YmFontName; extern YSeparator Sep1; extern YSeparator Sep2; extern Arg NilBord[]; extern XClientMessageEvent* YClientEvent; /* extern Arg Yarg[]; extern Cardinal Yi; */ extern Yres GRes; #define Yarg GRes.arg #define Yi GRes.i /***********************************************************************/ #endif /* _YMPROG_H */ /максимальное количество ресурсов. */
152 #define N_Narg 30
153 
154 /* Поддерживаемое число экранов - до 4-х / #define Screen_N 4 /* Список ресурсов для каждого объекта (Text, Button, Slider, Frame) */ typedef struct { short i, n; Arg arg[N_Narg]; } Yres; /* Список указателей на списки ресурсов различных объектов для всех экранов */ typedef struct { int n; Yres *res[Nnames*Screen_N]; } YResource; /* Глобальный список ресурсов. */ extern YResource YResources; /* Макрос для создания локальной переменной a - списка ресурсов указанной емкости b. */ #define StructYres(a,b) struct {short i,n; Arg arg[b];} a; a.i = 0; a.n = b; /* Тип обработчика событий в SDSTOOL. */ typedef int (*CallB)(int); /* Тип процедуры специального изображения переменной в SDSTOOL. */ typedef void (*PrnText)(); /* #define YFrame_ 0x0100 #define YMnstr_ 0x0200 #define YText_ 0x0400 #define YTextW_ 0x0500 #define YButton_ 0x0800 #define YLabel_ 0x1000 #define YDraw_ 0x2000 #define YScrollBar_ 0x4000 #define YScale_ 0x5000 #define YSeparator_ 0x8000 */ #define YAddType_ 0x000000ff #define YType_ 0x0000ff00 #define dLURD 0x000f0000 #define dLURD_ 0x00f00000 #define MnstrType(a_) ((a_) & YType_) /********************** DEFINES STRUCT ********************************/ #define dLeft 0x00010000 #define dLt dLeft #define dUp 0x00020000 #define dRight 0x00040000 #define dRt dRight #define dDown 0x00080000 #define dDn dDown #define dDnLt 0x00090000 #define dDnRt 0x000c0000 #define dRtDn 0x000c0000 #define dDnLtRt 0x000d0000 #define dUpLtRt 0x00070000 #define dDnUp 0x000a0000 #define dLtRt 0x00050000 #define dRtLt 0x00050000 #define dLeft_ 0x00100000 #define dUp_ 0x00200000 #define dRight_ 0x00400000 #define dDown_ 0x00800000 #define dDownF 0x00800000 #define dBottom (dDown | dLeft_) #define dAttach_ 0x00ff0000 #define dIOEvent 0x01000000 #define dScreen 0x02000000 #define dUnSensitive 0x04000000 #define dArmed 0x08000000 #define dUnmap 0x10000000 #define dUnvisible 0x10000000 #define dUserRes 0x20000000 #define dTitle 0x40000000 #define dTear 0x40000000 #define dHelp 0x80000000 #define dSouth dDown #define dNorth dUp #define dWest dLeft #define dEast dRight /*----------------------------------------------------------------------*/ #define dList 0x0001 #define dBeginning 0x0002 #define dForm 0x0004 #define dRowCol 0x0008 #define dScrWin 0x0010 #define dMenuBar 0x0020 #define dPopMenu 0x0040 #define YFrameMB_ 0x0120 #define YFrame_ 0x0100 #define YFrameR_ 0x0108 #define YFrameL_ 0x0101 #define YFrame_R (YFrame_ | dRight) #define YFrameR_R (YFrameR_ | dRight) #define YFrame_D (YFrame_ | dDown) #define YFrameR_D (YFrameR_ | dDown) #define YFrame_RD (YFrame_ | dDown | dRight) #define YFrameR_RD (YFrameR_ | dDown | dRight) #define YFrame_DR (YFrame_ | dDown | dRight) #define YFrameR_DR (YFrameR_ | dDown | dRight) #define YFrame_LR (YFrame_ | dLeft | dRight) #define YFrameR_RL (YFrameR_ | dLeft | dRight) #define YFrame_RL (YFrame_ | dLeft | dRight) #define YFrameR_LR (YFrameR_ | dLeft | dRight) #define YFrame_U (YFrame_ | dUp) #define YFrameR_U (YFrameR_ | dUp) #define YFrame_B (YFrame_ | dBeginning) #define YFrameR_B (YFrameR_ | dBeginning) #define YFrame_RB (YFrame_ | dRight | dBeginning) #define YFrameR_RB (YFrameR_ | dRight | dBeginning) #define YFrame_DB (YFrame_ | dDown | dBeginning) #define YFrameR_DB (YFrameR_ | dDown | dBeginning) #define YFrame_UB (YFrame_ | dUp | dBeginning) #define YFrameR_UB (YFrameR_ | dUp | dBeginning) /*----------------------------------------------------------------------*/ #define YMnstr_ 0x0200 #define dMenuShell 0x0004 /* MenuShell */ #define dFDialog 0x0001 /* resizable Form Dialog */ #define dBBDialog 0x0002 /* Bulletin Board Dialog */ #define dSDialog 0x0003 /* Shell Dialog */ #define dDialog 0x0007 #define dModal 0x0008 /* 31.10.2000 Modal popup window */ #define YMnstrD_ 0x0201 #define YMnstrSD_ 0x0203 #define YMnstrDS_ 0x0203 #define dNoResize 0x0080 #define dIcon 0x0040 /*#define dScrWin 0x0010*/ /*----------------------------------------------------------------------*/ #define YText_ 0x0400 #define dInt 0x0001 #define dFloat 0x0002 #define dChar 0x0004 #define dVal 0x0003 #define dScale 0x0008 #define dUnmapS 0x0080 #define dScaleU 0x0088 #define dScaleUnmap 0x0088 #define dSscaleUp_ 0x0020 #define dScaleUp 0x0028 #define dInp 0x0010 #define dFirst 0x02000000 #define dNoInverse 0x0040 #define YTextI_ 0x0401 #define YTextC_ 0x0404 #define YTextF_ 0x0402 #define YTextIS_ 0x0409 #define YTextFS_ 0x040a #define YText_R ( YText_ | dRight) #define YText_L ( YText_ | dLeft) #define YTextC_D ( YTextC_ | dDown ) #define YTextC_DR ( YTextC_ | dRight | dDown) #define YTextC_RD ( YTextC_ | dRight | dDown) #define YTextC_LR ( YTextC_ | dRight | dLeft) #define YTextC_RL ( YTextC_ | dRight | dLeft) #define YTextFU_ ( YTextF_ | dUserRes) #define YTextIU_ ( YTextI_ | dUserRes) #define YTextCU_ ( YTextC_ | dUserRes) #define YTextI_DR ( YTextI_ | dRight | dDown) #define YTextI_RD ( YTextI_ | dRight | dDown) #define YTextI_R ( YTextI_ | dRight) #define YTextI_L ( YTextI_ | dLeft) #define YTextI_LD ( YTextI_ | dLeft | dDown) #define YTextI_LR ( YTextI_ | dRight | dLeft) #define YTextI_RL ( YTextI_ | dRight | dLeft) #define YTextI_LRD ( YTextI_ | dRight | dDown | dLeft) #define YTextI_LDR ( YTextI_ | dRight | dDown | dLeft) #define YTextI_DLR ( YTextI_ | dRight | dDown | dLeft) #define YTextI_DRL ( YTextI_ | dRight | dDown | dLeft) #define YTextI_RDL ( YTextI_ | dRight | dDown | dLeft) #define YTextI_RLD ( YTextI_ | dRight | dDown | dLeft) #define YTextF_DR ( YTextF_ | dRight | dDown) #define YTextF_RD ( YTextF_ | dRight | dDown) #define YTextF_R ( YTextF_ | dRight) #define YTextF_L ( YTextF_ | dLeft) #define YTextF_LD ( YTextF_ | dLeft | dDown) #define YTextF_LR ( YTextF_ | dRight | dLeft) #define YTextF_RL ( YTextF_ | dRight | dLeft) #define YTextF_LRD ( YTextF_ | dRight | dDown | dLeft) #define YTextF_LDR ( YTextF_ | dRight | dDown | dLeft) #define YTextF_DLR ( YTextF_ | dRight | dDown | dLeft) #define YTextF_DRL ( YTextF_ | dRight | dDown | dLeft) #define YTextF_RDL ( YTextF_ | dRight | dDown | dLeft) #define YTextF_RLD ( YTextF_ | dRight | dDown | dLeft) /*----------------------------------------------------------------------*/ #define YTextW_ 0x0500 #define dScrH 0x0001 #define dScrV 0x0002 #define TextBackward 1 #define TextForward 0 /*----------------------------------------------------------------------*/ /*#define dArmed 0x08000000 Armed ToggelButton */ #define dALeft 0x10 #define dARight 0x20 #define dAUp 0x40 #define dADown 0x80 #define dArrowB 0xf0 #define dToggle 0x0004 #define dDrawn 0x0008 #define dCascade 0x0002 #define YButton_ 0x0800 #define YButtonT_ 0x0804 #define YButtonD_ 0x0808 #define YButtonC_ 0x0802 #define YButtonC_R (YButtonC_ | dRight) #define YButton_R (YButton_ | dRight) #define YButton_D (YButton_ | dDown) #define YButton_L (YButton_ | dLeft) #define YButton_RD (YButton_ | dRight | dDown) #define YButton_LD (YButton_ | dLeft | dDown) #define YButton_DL (YButton_ | dLeft | dDown) #define YButton_LDR (YButton_ | dLeft | dDown | dRight) #define YButton_DLR (YButton_ | dLeft | dDown | dRight) #define YButtonT_R (YButtonT_ | dRight) #define YButtonK YButton #define YButtonK_ YButton_ #define YButtonKT_ YButtonT_ #define YButtonTK_ YButtonT_ /*----------------------------------------------------------------------*/ #define YLabel_ 0x1000 #define YLabel_R (YLabel_ | dRight) #define YLabel_L (YLabel_ | dLeft) #define YLabel_D (YLabel_ | dDown) #define YLabel_U (YLabel_ | dUp) #define YLabel_RL (YLabel_ | dRight | dLeft) #define YLabel_LR (YLabel_ | dRight | dLeft) #define YLabel_DL (YLabel_ | dDown | dLeft) #define YLabel_RD (YLabel_ | dDown | dRight) #define YLabel_LD (YLabel_ | dDown | dLeft) #define YLabel_LDR (YLabel_ | dDown | dLeft | dRight) #define YLabel_DLR (YLabel_ | dDown | dLeft | dRight) /*----------------------------------------------------------------------*/ #define dHor_ 0x0001 #define dVer_ 0x0002 #define dHor 0x0001 #define dVer 0x0002 #define dPixmap_ 0x0004 #define dImage_ 0x0008 /*#define dDrawInP_ 0x0010*/ #define YDraw_ 0x2000 #define YDrawV_ 0x2002 #define YDrawH_ 0x2001 #define YDrawVH_ 0x2003 #define YDrawHV_ 0x2003 #define YDraw_P 0x2004 #define YDrawV_P 0x2006 #define YDrawH_P 0x2005 #define YDrawVH_P 0x2007 #define YDrawHV_P 0x2007 #define YDraw_I (0x2000 | dImage_) #define YDrawV_I (0x2002 | dImage_) #define YDrawH_I (0x2001 | dImage_) #define YDrawVH_I (0x2003 | dImage_) #define YDrawHV_I (0x2003 | dImage_) #define YDraw_PI (0x2004 | dImage_) #define YDrawV_PI (0x2006 | dImage_) #define YDrawH_PI (0x2005 | dImage_) #define YDrawVH_PI (0x2007 | dImage_) #define YDrawHV_PI (0x2007 | dImage_) /*----------------------------------------------------------------------*/ #define dShowValue 0x0004 #define YScale_ 0x5000 #define YScaleU_ (YScale_ | dUserRes) #define YScaleH_ (YScale_ | dHor) #define YScaleV_ (YScale_ | dVer) #define YScale_L (YScale_ | dLeft) #define YScaleH_L (YScale_ | dHor | dLeft) #define YScaleV_L (YScale_ | dVer | dLeft) #define YScale_R (YScale_ | dRight) #define YScaleH_R (YScale_ | dHor | dRight) #define YScaleV_R (YScale_ | dVer | dRight) #define YScale_RL (YScale_ | dRight | dLeft) #define YScaleH_RL (YScale_ | dHor | dRight | dLeft) #define YScaleV_RL (YScale_ | dVer | dRight | dLeft) #define YScale_D (YScale_ | dDown) #define YScaleH_D (YScale_ | dHor | dDown) #define YScaleV_D (YScale_ | dVer | dDown) /*----------------------------------------------------------------------*/ #define dArrow 0x04 #define dDrawSB_ 0x08 #define YScrollBar_ 0x4000 #define YScrollBarH_ (YScrollBar_ | dHor) #define YScrollBarV_ (YScrollBar_ | dVer) #define YScrollBar_L (YScrollBar_ | dLeft) #define YScrollBarH_L (YScrollBar_ | dHor | dLeft) #define YScrollBarV_L (YScrollBar_ | dVer | dLeft) #define YScrollBar_R (YScrollBar_ | dRight) #define YScrollBarH_R (YScrollBar_ | dHor | dRight) #define YScrollBarV_R (YScrollBar_ | dVer | dRight) #define YScrollBar_RL (YScrollBar_ | dRight | dLeft) #define YScrollBarH_RL (YScrollBar_ | dHor | dRight | dLeft) #define YScrollBarV_RL (YScrollBar_ | dVer | dRight | dLeft) #define YScrollBar_D (YScrollBar_ | dDown) #define YScrollBarH_D (YScrollBar_ | dHor | dDown) #define YScrollBarV_D (YScrollBar_ | dVer | dDown) /*----------------------------------------------------------------------*/ #define YSeparator_ 0x8000 #define YSeparatorH_ (YSeparator_ | dHor) #define YSeparatorV_ (YSeparator_ | dVer) #define YSeparator_L (YSeparator_ | dLeft) #define YSeparatorH_L (YSeparator_ | dHor | dLeft) #define YSeparatorV_L (YSeparator_ | dVer | dLeft) #define YSeparator_R (YSeparator_ | dRight) #define YSeparatorH_R (YSeparator_ | dHor | dRight) #define YSeparatorV_R (YSeparator_ | dVer | dRight) #define YSeparator_RL (YSeparator_ | dRight | dLeft) #define YSeparatorH_RL (YSeparator_ | dHor | dRight | dLeft) #define YSeparatorV_RL (YSeparator_ | dVer | dRight | dLeft) #define YSeparator_D (YSeparator_ | dDown) #define YSeparatorH_D (YSeparator_ | dHor | dDown) #define YSeparatorV_D (YSeparator_ | dVer | dDown) /*----------------------------------------------------------------------*/ #define YActivate 0x4001 #define YLoose 0x4002 #define YArm 0x4003 #define YEnter 0x4004 #define YDisArm 0x4005 #define YFocus 0x4006 #define YMove 0x4007 #define YSelect 0x4008 #define YExpose 0x4009 #define YInput 0x400a #define YResize 0x400b #define YClick 0x400c #define YChanged 0x400d #define YEsc 0x400e #define YCancel 0x400e #define YZoom 0x400f #define YOk 0x4010 #define YApply 0x4011 #define YHelp 0x4012 #define YInitZoom 0x4013 #define YTimeOut 0x4014 #define YClient 0x4015 #define YNewClient 0x4016 #define YKillClient 0x4017 #define YResizeR 0x4018 #define YModify 0x4019 #define YRefresh 0x401a #define YCreate 0x401b #define YPrimLoose 0x401c #define YPrimFocus 0x401d #define YDragScale 0x401e #define YCopy 0x401f #define YXorExpose 0x4020 #define YLoad 0x4021 #define YSave 0x4022 #define YDrag 0x4023 #define YIncrementV 0x01 #define YDecrementV 0x02 #define YChangedV 0x03 #define YDragV 0x04 #define YIncrementH 0x11 #define YDecrementH 0x12 #define YChangedH 0x13 #define YDragH 0x14 /*----------------------------------------------------------------------------*/ typedef struct { unsigned char* data_name; /* data or filename for icon */ char* icon_name; short icon_file, icon_depth; short icon_width,icon_height; Pixmap icon_pixmap; int icon_count; } YIcon; typedef struct { YIcon Icon; int fg,count; Window win; GC gc; } YIconTitle; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget */ } YUnion; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget */ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ } YButton; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget */ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ short n; void** T; } YButtonC; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; int slider_size; int increment; int page_increment; void* user; } YScrollBar; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; short thickness,length; int increment; int decimalPoints; void* user; } YScale; typedef YScrollBar YmScrollBarValues; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short width; short height; char* fontname; GC gc; void* usr; Window win; XFontStruct* font; short ch_w, ch_h; short x,y; int x_root, y_root; /* coordinates relative to root */ unsigned int eType, keycode; /* detail */ int foreground, background; /*signed */char mode,clip,WinDraw,CgmDraw; YScrollBar Vs; YScrollBar Hs; XEvent* Draw_event; Pixmap pixmap; XImage* image; int cyrsor_type; Cursor cursor; short x1, y1, w1, h1; /* Clip box */ short count,key; /* Not use it */ void* vol; /* Not use it */ int CgmWidth,CgmHeight,CgmX,CgmY; int ScreenId; /* !vlad! */ } YDraw; typedef struct { int type; char* name; short res; Widget w; /* return creating widget*/ YIcon* I; /* structure for icon */ } YLabel; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; } YText; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short rows,columns; short c_row,c_col; char* buf; } YTextW; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; short maxlen; char* value; } YTextC; #define YTextS YTextC typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; } YTextI; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; } YTextF; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; } YFrame; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; short row; } YFrameR; typedef struct { int type; char* name; short res; short thickness,width,height; Widget w; } YSeparator; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** F; YIcon* I; /* structure for icon */ Widget form; } YMnstr; /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ Arg* args; } YrButton; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short KeyIn,KeyOut; YIcon* I; /* structure for icon */ Arg* args; short n; void** T; } YrButtonC; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; int slider_size; int increment; int page_increment; void* user; Arg* args; } YrScrollBar; typedef struct { int type; char* name; short res; CallB cb; Widget w; int value; int minimum; int maximum; short thickness,length; int increment; int decimalPoints; void* user; Arg* args; } YrScale; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short width; short height; char* fontname; GC gc; void* usr; Window win; XFontStruct* font; short ch_w, ch_h; short x,y; int x_root, y_root; /* coordinates relative to root */ unsigned int eType, keycode; /* detail */ int foreground, background; char mode,clip,WinDraw,PixmapDraw; YScrollBar Vs; YScrollBar Hs; XEvent* Draw_event; Pixmap pixmap; XImage* image; int cyrsor_type; Cursor cursor; short x1, y1, w1, h1; /* Clip box */ short count,key; /* Not use it */ void* vol; /* Not use it */ int CgmWidth,CgmHeight,CgmX,CgmY; Arg* args; } YrDraw; typedef struct { int type; char* name; short res; Widget w; /* return creating widget*/ YIcon* I; /* structure for icon */ Arg* args; } YrLabel; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; Arg* args; } YrText; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short rows,columns; short c_row,c_col; char* buf; Arg* args; } YrTextW; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; short maxlen; char* value; Arg* args; } YrTextC; #define YrTextS YrTextC typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; Arg* args; } YrTextI; typedef struct { int type; char* name; short res; CallB cb; Widget w; /* return creating widget*/ short len; PrnText P; float value; float minv; float maxv; Widget s; Arg* args; } YrTextF; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; Arg* args; } YrFrame; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** T; short row; Arg* args; } YrFrameR; typedef struct { int type; char* name; short res; short thickness,width,height; Widget w; Arg* args; } YrSeparator; typedef struct { int type; char* name; short res; short n; Widget w; /* return creating widget*/ void** F; YIcon* I; /* structure for icon */ Widget form; Arg* args; } YrMnstr; typedef union { int type; YUnion Un; YText Text; YTextS TextS; YTextI TextI; YTextF TextF; YTextW TextW; YButton Button; YButtonC ButtonC; YLabel Label; YFrame Frame; YFrameR FrameR; YDraw Draw; YScrollBar ScrollBar; YScale Scale; YSeparator Separator; YMnstr Mnstr; YrText rText; YrTextS rTextS; YrTextI rTextI; YrTextF rTextF; YrTextW rTextW; YrButton rButton; YrButtonC rButtonC; YrLabel rLabel; YrFrame rFrame; YrFrameR rFrameR; YrDraw rDraw; YrScrollBar rScrollBar; YrScale rScale; YrSeparator rSeparator; YrMnstr rMnstr; } YType; #define DLabel(var, type,name,res, Ic) \ YLabel var = {YLabel_|type,name,res,0,Ic} #define DrLabel(var, type,name,res, Ic,args) \ YrLabel var = {YLabel_|dUserRes|type,name,res,0,Ic,args} #define DTextF(var, type,name,res,cb, len,P,value,minv,maxv) \ YTextF var = {YTextF_|type,name,res,cb,0,len,P,value,minv,maxv} #define DrTextF(var, type,name,res,cb, len,P,value,minv,maxv, args) \ YrTextF var = {YTextFU_|type,name,res,cb,0,len,P,value,minv,maxv,0,args} #define DTextC( var, type,name,res,cb, len,maxlen,value) \ YTextC var = {YTextC_|type,name,res,cb,0,len,maxlen,value} #define DrTextC(var, type,name,res,cb, len,maxlen,value,args) \ YrTextC var = {YTextCU_|type,name,res,cb,0,len,maxlen,value,args} #define DTextI(var, type,name,res,cb, len,P,value,minv,maxv) \ YTextI var = {YTextI_|type,name,res,cb,0,len,P,value,minv,maxv} #define DrTextI(var, type,name,res,cb, len,P,value,minv,maxv, args) \ YrTextI var = {YTextIU_|type,name,res,cb,0,len,P,value,minv,maxv,0,args} #define DText(var, type,name,res,cb, len) \ YText var = {YText_|type,name,res,cb,0,len} #define DrText(var, type,name,res,cb, len,args) \ YrText var = {YText_|dUserRes|type,name,res,cb,0,len,args} #define DrScale(var, type,name,res,cb, val,mi,ma,thck,len,incr,d,args) \ YrScale var = {YScaleU_|type,name,res,cb,0,val,mi,ma,thck,len,incr,d,args} #define DScale(var, type,name,res,cb, val,mi,ma,thck,len,incr,d) \ YScale var = {YScale_|type,name,res,cb,0,val,mi,ma,thck,len,incr,d} #define DButton(var, type,name,res,cb, kIn,kOut,Ic) \ YButton var = {YButton_|type,name,res,cb,0,kIn,kOut,Ic} #define DrButton(var, type,name,res,cb, kIn,kOut,Ic,args) \ YButton var = {YButton_|type,name,res,cb,0,kIn,kOut,Ic,args} #define DButtonT(var, type,name,res,cb, kIn,kOut,Ic) \ YButton var = {YButtonT_|type,name,res,cb,0,kIn,kOut,Ic} #define DrButtonT(var, type,name,res,cb, kIn,kOut,Ic,args) \ YButton var = {YButtonT_|type,name,res,cb,0,kIn,kOut,Ic,args} #define DButtonC(var, type,name,res,cb, kIn,kOut,Ic,n,T) \ YButtonC var = {YButtonC_|type,name,res,cb,0,kIn,kOut,Ic,n,T} #define DrButtonC(var, type,name,res,cb, kIn,kOut,Ic,args,n,T) \ YrButtonC var = {YButtonC_|dUserRes|type,name,res,cb,0,kIn,kOut,Ic,args,n,T} #define DMnstrD(var, type,name,res,n, F,I) \ YMnstr var = {YMnstrD_|type,name,res,n,0,F,I} #define DrMnstrD(var, type,name,res,n, F,I, args) \ YrMnstr var = {YMnstrD_|dUserRes|type,name,res,n,0,F,I,0,args} #define DFrame(var, type,name,res,n, F) \ YFrame var = {YFrame_|type,name,res,n,0,F} #define DrFrame(var, type,name,res,n, F,args) \ YrFrame var = {YFrame_|dUserRes|type,name,res,n,0,F,args} #define DFrameR(var, type,name,res,n, F,row) \ YFrameR var = {YFrameR_|type,name,res,n,0,F,row} #define DrFrameR(var, type,name,res,n, F,row,args) \ YrFrameR var = {YFrameR_|dUserRes|type,name,res,n,0,F,row,args} #ifndef Y_UTIL #define Y_UTIL #define ClearFlag(a,f) a &= ~(f) #define SetFlag(a,f) a |= (f) #define Is(a,f) if(((a) & (f)) == (f)) #define IsNo(a,f) if(((a) & (f)) != (f)) #define IsNot(a,f) if(((a) & (f)) == 0) #define Cpy(a,b1) strcpy(a,b1) #define CpyCat(a,b1,b2) strcat(strcpy(a,b1),b2) #define CpyCatCat(a,b1,b2,b3) strcat(strcat(strcpy(a,b1),b2),b3) #define CpyCatCatCat(a,b1,b2,b3,b4) strcat(strcat(strcat(strcpy(a,b1),b2),b3),b4) #define Cat(a,b1) strcat(a,b1) #define CatCat(a,b1,b2) strcat(strcat(a,b1),b2) #define CatCatCat(a,b1,b2,b3) strcat(strcat(strcat(a,b1),b2),b3) #endif /*Y_UTIL*/ #define YmSetValueT(a,b) YmSetValue((YType*) (a),b) #define CloseMonstr(a) YmCloseMonstr_((YType*) (a)) #define YmCloseMonstr(a) YmCloseMonstr_((YType*) (a)) #define KillMonstr(a) YmKillMonstr_((YType*) (a)) #define YmKillMonstr(a) YmKillMonstr_((YType*) (a)) #define IsMonstrKilled(a) (Boolean)YtWidget((YType*)(a)) #define YtWidget(a) YtWidget_((YType*)(a)) #define YmWidget(a) YtWidget_((YType*)(a)) #define YtSetSensitive(t,b) YtSetSensitive_((YType*)(t),b) #define YtGetSensitive(t) YtGetSensitive_((YType*)(t)) #define YmSetVisible(t,b) YmSetVisible_((YType*)(t),b) #define YmGetVisible(t) YmGetVisible_((YType*)(t)) #define YmWidth(t) YmWidth_((YType*)(t)) #define YmHeight(t) YmHeight_((YType*)(t)) #define YmResizeMonstr(t,a,b) YmResizeMonstr_((YType*)(t),a,b) #define YmNOutKey(cb,n,a) YmNOutKey_(cb,n,(caddr_t)a) #define YmResizeParentMonstr(t,a,b) YmResizeParentMonstr_((YType*)(t),a,b) /********************* FORWARD DEFINES *********************************/ #ifdef _NO_PROTO_ void ChangeFileExt(); char* SetStrLen(); int Call_Back(); int YmTimeOut(); int YmNOut(); int YmNOutKey_(); int Get_Time(); int YtMalloc(); void* YtFree(); void* YuFree(); void* YFree(); void* YmStringFree(); Widget YmInitShell(); Widget YmCreateMonstr(); void YmCreateMonstrTime(); void YmKillMonstr_(); void YmCloseMonstr_(); Widget YmCreateWidget(); Widget CreateDialog(); void YmRealizeMainMonstr(); int YmResizeMonstr_(); int YmResizeParentMonstr_(); void YtJumpWidget(); int YmUpdateDisplay(); int YtUpdateFrame(); int YtSetBorderValues(); void YtJampWidget(); int YtWidth(); int YtHeight(); int YmWidth_(); int YmHeight_(); Widget YtWidget_(); int YtSetArg_ (); int YtSetArg0_(); int YtSetArgPtr(); int YtSetArgPtrVerify(); int YtCopyArgPtr(); int YtCopyArgPtrDef(); int YtDeleteArg(); void YtGetValues(); void YtSetValues(); void YtSetValuesPtr(); int YtGetValuesPtr(); int YtGetValuePtr(); XtArgVal YtGetValue(); void YtSetValue(); void YtCopyWidgetValue(); int YtFindArg(); int YtGetValueDef(); int YmSetArgDef(); int YmSetArgDefName(); int YtSetColorArgPtrDef(); int YtGetAllResource(); int YtSetResourceArg(); void YmAttach(); void YmAttachS(); void YmNilAttach(); XmString YmNlabelString (); XmString YmNacceleratorText(); char* YmSetLabelName(); XImage* YtCreateDefaultImage(); int YtWarning(char *format, ...); void YtSetTranslation(); int YtSetAction(); int YtSetAction_Num(); void PrintActions(); void PrintValue(); int YmSetValue(); void YmGetTextValue(); double SetNumberTextValue(); void YmTypeText(); int YmScrollBarGetValues(); int YmScrollBarSetValues(); int YmScrollBarSetValues_(); Boolean YmToggleButtonGetState(); int YmToggleButtonSetState(); Boolean YtGetSensitive_(); int YtSetSensitive_(); Boolean YmGetVisible_(); int YmSetVisible_(); void SetWidgetColor(); void YmSetColor(); int YmGetColor(); void YmSetColorNameRes(); void YmSetInverseColorNameRes(); void YmSendClientMessage(); Window* YtSetOutputWindows(); int YmLoadFont(); int YtLoadFont(); int YtLoadFont_(); int FreeFontStructs(); XGCValues* YmGetGCValues(); int YmDeleteFontCursor(); int YmCreateFontCursor(); void YmTextSetCursorPosition(); int YtGetWindowXY(); Window YtGetParentWindow(); void YGeometry(); void YtSetWidgetColor(); int YmButtonArmDisArm(); int AddOutputWindow(); int DelOutputWindow(); int YErrorHandler(); YType* WidgetToYType(); int YtSetInputMonstr(); void YmSendClientMessage(); void YSendEvent(); void YClientMessage(); Display* YDisplay_(); Screen* YScreen_(); Screen* YtScreen(); Window YmRootWindow_(); Window YtRootWindow(); GC YDefaultGC_(); GC YtDefaultGC(); GC ScreenDefaultGC(); Window ScreenRootWindow(); void YmChangeTextLabel (); void YmNoEditBorder (); #else /* _NO_PROTO_ */ char* SetStrLen(char* str,int len); void ChangeFileExt(char *filename,char *ext); int Call_Back(CallB cb, int key); int YmTimeOut(CallB cb,int t); int YmNOut(CallB cb,int t); int YmNOutKey_(CallB cb,int t,caddr_t key); int Get_Time(int i); int YtMalloc(void* buf, long sz); void* YtFree(void *buf); void* YuFree(void *buf); void* YFree(void *buf); void* YmStringFree(XmString buf); Widget YmInitShell(char* name,char* resname,int argc,char **argv); Widget YmCreateMonstr(Widget parent,char* dpyName,YMnstr* ms); void YmCreateMonstrTime(Widget parent,char* dpyName,YMnstr* t); void YmKillMonstr_(YType* m); void YmCloseMonstr_(YType* t); Widget YmCreateWidget(Widget parent,int parentType,YType* t); Widget CreateDialog(Widget parent,char *name); void YmRealizeMainMonstr(YMnstr* t); int YmResizeMonstr_(YType* t,int width,int height); int YmResizeParentMonstr_(YType* t,int width,int height); void YtJumpWidget(YType* t); int YmUpdateDisplay(YType* t); int YtUpdateFrame(YFrame* fr,YMnstr* mn); int YtSetBorderValues(Widget w,int shadowTyp,int shadowTh, int borderW, int highlightTh); void YtJampWidget(YType* t); int YtWidth(Widget w); int YtHeight(Widget w); int YmWidth_(YType* t); int YmHeight_(YType* t); Widget YtWidget_(YType* t); int YtSetArg_ (char* name,XtArgVal d); int YtSetArg0_(char* name,XtArgVal d); int YtSetArgPtr(Yres* res,char* name,XtArgVal value); int YtSetArgPtrVerify(Yres* res,char* name,XtArgVal value); int YtCopyArgPtr(Yres* yr1,Yres* yr2,char *name1,char *name2); int YtCopyArgPtrDef(Yres* yr1,int defname,char *name1,char *name2); int YtDeleteArg(char* name); void YtGetValues(Widget w); void YtSetValues(Widget w); void YtSetValuesPtr(Widget w,Yres* res); int YtGetValuesPtr(Widget w,Yres* res); int YtGetValuePtr(Yres* yr2,char *name,XtArgVal* val); XtArgVal YtGetValue(Widget w,char* name); void YtSetValue(Widget w, char* name, XtArgVal value); void YtCopyWidgetValue(Widget w,char* name1,char* name2); int YtFindArg(char* name1,char* name2,int nname); int YtGetValueDef(int defname,char *name,XtArgVal* val); int YmSetArgDef(YType* t); int YmSetArgDefName(int res,int OnlyColor); int YtSetColorArgPtrDef(Yres* yr,int nname); int YtGetAllResource(Widget parent); int YtSetResourceArg(int nname); void YmAttach(Widget L,Widget T,Widget R,Widget B, int sl,int st,int sr,int sb); void YmAttachS( ATTACH_OBJ *att); void YmNilAttach(void); XmString YmNlabelString (char *label,int mnemonic); XmString YmNacceleratorText(char* accel_name,char* accel_key); char* YmSetLabelName(char* name); XImage* YtCreateDefaultImage(char *bits,int width,int height); int YtWarning(char *format, ...); void YtSetTranslation( Widget w, char* app_name, char* key_sym, XtActionProc proc); int YtSetAction(Widget w,char *name,char *sym); int YtSetAction_Num(Widget w,char *name,char *sym,int i); void PrintActions(Widget w); void YmNoEditBorder (YType* t); void YmChangeTextLabel (YType* t, char* str); void PrintValue(YType* t,double val); int YmSetValue(YType* t,void* value); void YmGetTextValue(YType* t); double SetNumberTextValue(YType* t,double value); void YmTypeText(Widget w,char* str); int YmScrollBarGetValues(YScrollBar* s); int YmScrollBarSetValues(YScrollBar* s); int YmScrollBarSetValues_(YScrollBar* s, int minimum,int maximum,int value, int slider_size,int increment,int page_increment); Boolean YmToggleButtonGetState(YType* t); int YmToggleButtonSetState(YType* t,int state); Boolean YtGetSensitive_(YType* t); int YtSetSensitive_(YType* t,int state); Boolean YmGetVisible_(YType* t); int YmSetVisible_(YType* t,int b); void SetWidgetColor(Widget w, int name); void YmSetColor(YType* t, int foreground,int background); int YmGetColor(YType* t, int *foreground,int *background); void YmSetColorNameRes(YType* t, int name); void YmSetInverseColorNameRes(YType* t, int name); void YmSendClientMessage(void* data,int type,Window* win,int nn); Window* YtSetOutputWindows(char* Wname[],int n,int *nn); int YmLoadFont(YType* t,char *FontName); int YtLoadFont(Widget w,char *FontName); int YtLoadFont_(char* FontName,int dr); int FreeFontStructs(void); XGCValues* YmGetGCValues(GC gc); int YmDeleteFontCursor(YDraw* yd); int YmCreateFontCursor(YDraw* yd,int cyrsor_type); void YmTextSetCursorPosition(Widget w, XmTextPosition p); int YtGetWindowXY(Window win,int *x,int *y); Window YtGetParentWindow(Display* dpy,Window win); void YGeometry(Widget w,int type); void YtSetWidgetColor(Widget w, int fg,int bg); int YmButtonArmDisArm(YType* t); int AddOutputWindow(Window win); int DelOutputWindow(Window win); int YErrorHandler(Display* disp,XErrorEvent* er); YType* WidgetToYType(Widget w); int YtSetInputMonstr(YType* t); void YmSendClientMessage(void* data,int type,Window* win,int nn); void YSendEvent(int type,int keycode,int x,int y); Display* YDisplay_(YType* t); Screen* YScreen_(YType* t); Screen* YtScreen(Widget w); Window YmRootWindow_(YType* t); Window YtRootWindow(Widget w); Window ScreenRootWindow(Screen* scr); GC YDefaultGC_(YType* t); GC YtDefaultGC(Widget w); GC ScreenDefaultGC(Screen* scr); void YClientMessage( Widget w,char* name,Atom a, int format, EventMask mask); void YmChangeTextLabel (YType* t, char* str); void YmNoEditBorder (YType* t); #endif /* _NO_PROTO_ */ #define Screen_N 4 #define YtDisplay(w) XtDisplay(w) #define YDisplay(t) YDisplay_((YType*) t) #define YmDisplay(t) YDisplay_((YType*) t) #define YScreen(t) YScreen_((YType*) t) #define YmScreen_(t) YScreen_((YType*) t) #define YmRootWindow(t) YmRootWindow_((YType*) t) #define YDefaultGC(t) YDefaultGC_((YType*) t) #define YmDefaultGC(t) YDefaultGC_((YType*) t) /********************** External var ************************************/ extern int ScreenId; extern XtAppContext app_context; /* Application Context */ extern Display* display; extern Colormap Ycmap; extern XEvent YEvent; extern XKeyEvent* TB_event; extern char* YTextPntr; extern int YTextLength; extern Window YRootWindow; extern short YRootWidth,YRootHeight; extern int YRootForeground,YRootBackground; extern GC YRootGC; extern int YDefaultScreen; extern Menu_struct Menu_env; extern Widget Top_level; extern Widget YMenu_Bar; extern Widget ButtonW; extern YType* MnstrD; extern YDraw* Draw_s; extern XEvent* Draw_event; extern Window Draw_win; extern int Ykey; extern YScrollBar* Draw_Sc; extern char* YmFontName; extern YSeparator Sep1; extern YSeparator Sep2; extern Arg NilBord[]; extern XClientMessageEvent* YClientEvent; /* extern Arg Yarg[]; extern Cardinal Yi; */ extern Yres GRes; #define Yarg GRes.arg #define Yi GRes.i /***********************************************************************/ #endif /* _YMPROG_H */ */
155 #define Screen_N 4
156 
157 /* Список ресурсов для каждого объекта (Text, Button, Slider, Frame) */
158 typedef struct
159 {
160  short i, n;
161  Arg arg[N_Narg];
162 } Yres;
163 
164 /* Список указателей на списки ресурсов различных объектов для всех экранов */
165 typedef struct
166 {
167  int n;
168  Yres *res[Nnames*Screen_N];
169 } YResource;
170 
171 /* Глобальный список ресурсов. */
172 extern YResource YResources;
173 
174 
175 /* Макрос для создания локальной переменной a - списка ресурсов
176  указанной емкости b. */
177 #define StructYres(a,b) struct {short i,n; Arg arg[b];} a; a.i = 0; a.n = b;
178 
179 /* Тип обработчика событий в SDSTOOL. */
180 typedef int (*CallB)(int);
181 
182 /* Тип процедуры специального изображения переменной в SDSTOOL. */
183 typedef void (*PrnText)();
184 
185 
186 /*
187 #define YFrame_ 0x0100
188 #define YMnstr_ 0x0200
189 #define YText_ 0x0400
190 #define YTextW_ 0x0500
191 #define YButton_ 0x0800
192 #define YLabel_ 0x1000
193 #define YDraw_ 0x2000
194 #define YScrollBar_ 0x4000
195 #define YScale_ 0x5000
196 #define YSeparator_ 0x8000
197 */
198 #define YAddType_ 0x000000ff
199 #define YType_ 0x0000ff00
200 #define dLURD 0x000f0000
201 #define dLURD_ 0x00f00000
202 #define MnstrType(a_) ((a_) & YType_)
203 /********************** DEFINES STRUCT ********************************/
204 #define dLeft 0x00010000
205 #define dLt dLeft
206 #define dUp 0x00020000
207 #define dRight 0x00040000
208 #define dRt dRight
209 #define dDown 0x00080000
210 #define dDn dDown
211 #define dDnLt 0x00090000
212 #define dDnRt 0x000c0000
213 #define dRtDn 0x000c0000
214 #define dDnLtRt 0x000d0000
215 #define dUpLtRt 0x00070000
216 #define dDnUp 0x000a0000
217 #define dLtRt 0x00050000
218 #define dRtLt 0x00050000
219 
220 #define dLeft_ 0x00100000
221 #define dUp_ 0x00200000
222 #define dRight_ 0x00400000
223 #define dDown_ 0x00800000
224 #define dDownF 0x00800000
225 #define dBottom (dDown | dLeft_)
226 #define dAttach_ 0x00ff0000
227 
228 #define dIOEvent 0x01000000
229 #define dScreen 0x02000000
230 #define dUnSensitive 0x04000000
231 #define dArmed 0x08000000
232 
233 #define dUnmap 0x10000000
234 #define dUnvisible 0x10000000
235 #define dUserRes 0x20000000
236 #define dTitle 0x40000000
237 #define dTear 0x40000000
238 #define dHelp 0x80000000
239 
240 
241 #define dSouth dDown
242 #define dNorth dUp
243 #define dWest dLeft
244 #define dEast dRight
245 
246 
247 /*----------------------------------------------------------------------*/
248 #define dList 0x0001
249 #define dBeginning 0x0002
250 #define dForm 0x0004
251 #define dRowCol 0x0008
252 #define dScrWin 0x0010
253 #define dMenuBar 0x0020
254 #define dPopMenu 0x0040
255 #define YFrameMB_ 0x0120
256 #define YFrame_ 0x0100
257 #define YFrameR_ 0x0108
258 #define YFrameL_ 0x0101
259 
260 #define YFrame_R (YFrame_ | dRight)
261 #define YFrameR_R (YFrameR_ | dRight)
262 
263 #define YFrame_D (YFrame_ | dDown)
264 #define YFrameR_D (YFrameR_ | dDown)
265 
266 #define YFrame_RD (YFrame_ | dDown | dRight)
267 #define YFrameR_RD (YFrameR_ | dDown | dRight)
268 #define YFrame_DR (YFrame_ | dDown | dRight)
269 #define YFrameR_DR (YFrameR_ | dDown | dRight)
270 
271 #define YFrame_LR (YFrame_ | dLeft | dRight)
272 #define YFrameR_RL (YFrameR_ | dLeft | dRight)
273 #define YFrame_RL (YFrame_ | dLeft | dRight)
274 #define YFrameR_LR (YFrameR_ | dLeft | dRight)
275 
276 #define YFrame_U (YFrame_ | dUp)
277 #define YFrameR_U (YFrameR_ | dUp)
278 
279 #define YFrame_B (YFrame_ | dBeginning)
280 #define YFrameR_B (YFrameR_ | dBeginning)
281 
282 #define YFrame_RB (YFrame_ | dRight | dBeginning)
283 #define YFrameR_RB (YFrameR_ | dRight | dBeginning)
284 
285 #define YFrame_DB (YFrame_ | dDown | dBeginning)
286 #define YFrameR_DB (YFrameR_ | dDown | dBeginning)
287 
288 #define YFrame_UB (YFrame_ | dUp | dBeginning)
289 #define YFrameR_UB (YFrameR_ | dUp | dBeginning)
290 
291 /*----------------------------------------------------------------------*/
292 #define YMnstr_ 0x0200
293 #define dMenuShell 0x0004 /* MenuShell */
294 #define dFDialog 0x0001 /* resizable Form Dialog */
295 #define dBBDialog 0x0002 /* Bulletin Board Dialog */
296 #define dSDialog 0x0003 /* Shell Dialog */
297 #define dDialog 0x0007
298 #define dModal 0x0008 /* 31.10.2000 Modal popup window */
299 #define YMnstrD_ 0x0201
300 #define YMnstrSD_ 0x0203
301 #define YMnstrDS_ 0x0203
302 #define dNoResize 0x0080
303 #define dIcon 0x0040
304 
305 /*#define dScrWin 0x0010*/
306 /*----------------------------------------------------------------------*/
307 #define YText_ 0x0400
308 
309 #define dInt 0x0001
310 #define dFloat 0x0002
311 #define dChar 0x0004
312 #define dVal 0x0003
313 #define dScale 0x0008
314 #define dUnmapS 0x0080
315 #define dScaleU 0x0088
316 #define dScaleUnmap 0x0088
317 #define dSscaleUp_ 0x0020
318 #define dScaleUp 0x0028
319 #define dInp 0x0010
320 #define dFirst 0x02000000
321 #define dNoInverse 0x0040
322 #define YTextI_ 0x0401
323 #define YTextC_ 0x0404
324 #define YTextF_ 0x0402
325 #define YTextIS_ 0x0409
326 #define YTextFS_ 0x040a
327 #define YText_R ( YText_ | dRight)
328 #define YText_L ( YText_ | dLeft)
329 #define YTextC_D ( YTextC_ | dDown )
330 #define YTextC_DR ( YTextC_ | dRight | dDown)
331 #define YTextC_RD ( YTextC_ | dRight | dDown)
332 #define YTextC_LR ( YTextC_ | dRight | dLeft)
333 #define YTextC_RL ( YTextC_ | dRight | dLeft)
334 #define YTextFU_ ( YTextF_ | dUserRes)
335 #define YTextIU_ ( YTextI_ | dUserRes)
336 #define YTextCU_ ( YTextC_ | dUserRes)
337 
338 #define YTextI_DR ( YTextI_ | dRight | dDown)
339 #define YTextI_RD ( YTextI_ | dRight | dDown)
340 #define YTextI_R ( YTextI_ | dRight)
341 #define YTextI_L ( YTextI_ | dLeft)
342 #define YTextI_LD ( YTextI_ | dLeft | dDown)
343 #define YTextI_LR ( YTextI_ | dRight | dLeft)
344 #define YTextI_RL ( YTextI_ | dRight | dLeft)
345 #define YTextI_LRD ( YTextI_ | dRight | dDown | dLeft)
346 #define YTextI_LDR ( YTextI_ | dRight | dDown | dLeft)
347 #define YTextI_DLR ( YTextI_ | dRight | dDown | dLeft)
348 #define YTextI_DRL ( YTextI_ | dRight | dDown | dLeft)
349 #define YTextI_RDL ( YTextI_ | dRight | dDown | dLeft)
350 #define YTextI_RLD ( YTextI_ | dRight | dDown | dLeft)
351 
352 #define YTextF_DR ( YTextF_ | dRight | dDown)
353 #define YTextF_RD ( YTextF_ | dRight | dDown)
354 #define YTextF_R ( YTextF_ | dRight)
355 #define YTextF_L ( YTextF_ | dLeft)
356 #define YTextF_LD ( YTextF_ | dLeft | dDown)
357 #define YTextF_LR ( YTextF_ | dRight | dLeft)
358 #define YTextF_RL ( YTextF_ | dRight | dLeft)
359 #define YTextF_LRD ( YTextF_ | dRight | dDown | dLeft)
360 #define YTextF_LDR ( YTextF_ | dRight | dDown | dLeft)
361 #define YTextF_DLR ( YTextF_ | dRight | dDown | dLeft)
362 #define YTextF_DRL ( YTextF_ | dRight | dDown | dLeft)
363 #define YTextF_RDL ( YTextF_ | dRight | dDown | dLeft)
364 #define YTextF_RLD ( YTextF_ | dRight | dDown | dLeft)
365 /*----------------------------------------------------------------------*/
366 #define YTextW_ 0x0500
367 #define dScrH 0x0001
368 #define dScrV 0x0002
369 
370 #define TextBackward 1
371 #define TextForward 0
372 
373 /*----------------------------------------------------------------------*/
374 /*#define dArmed 0x08000000 Armed ToggelButton */
375 #define dALeft 0x10
376 #define dARight 0x20
377 #define dAUp 0x40
378 #define dADown 0x80
379 #define dArrowB 0xf0
380 
381 #define dToggle 0x0004
382 #define dDrawn 0x0008
383 #define dCascade 0x0002
384 #define YButton_ 0x0800
385 #define YButtonT_ 0x0804
386 #define YButtonD_ 0x0808
387 #define YButtonC_ 0x0802
388 
389 #define YButtonC_R (YButtonC_ | dRight)
390 #define YButton_R (YButton_ | dRight)
391 #define YButton_D (YButton_ | dDown)
392 #define YButton_L (YButton_ | dLeft)
393 #define YButton_RD (YButton_ | dRight | dDown)
394 #define YButton_LD (YButton_ | dLeft | dDown)
395 #define YButton_DL (YButton_ | dLeft | dDown)
396 #define YButton_LDR (YButton_ | dLeft | dDown | dRight)
397 #define YButton_DLR (YButton_ | dLeft | dDown | dRight)
398 #define YButtonT_R (YButtonT_ | dRight)
399 
400 #define YButtonK YButton
401 #define YButtonK_ YButton_
402 #define YButtonKT_ YButtonT_
403 #define YButtonTK_ YButtonT_
404 /*----------------------------------------------------------------------*/
405 #define YLabel_ 0x1000
406 #define YLabel_R (YLabel_ | dRight)
407 #define YLabel_L (YLabel_ | dLeft)
408 #define YLabel_D (YLabel_ | dDown)
409 #define YLabel_U (YLabel_ | dUp)
410 #define YLabel_RL (YLabel_ | dRight | dLeft)
411 #define YLabel_LR (YLabel_ | dRight | dLeft)
412 #define YLabel_DL (YLabel_ | dDown | dLeft)
413 #define YLabel_RD (YLabel_ | dDown | dRight)
414 #define YLabel_LD (YLabel_ | dDown | dLeft)
415 #define YLabel_LDR (YLabel_ | dDown | dLeft | dRight)
416 #define YLabel_DLR (YLabel_ | dDown | dLeft | dRight)
417 /*----------------------------------------------------------------------*/
418 #define dHor_ 0x0001
419 #define dVer_ 0x0002
420 #define dHor 0x0001
421 #define dVer 0x0002
422 #define dPixmap_ 0x0004
423 #define dImage_ 0x0008
424 /*#define dDrawInP_ 0x0010*/
425 
426 #define YDraw_ 0x2000
427 #define YDrawV_ 0x2002
428 #define YDrawH_ 0x2001
429 #define YDrawVH_ 0x2003
430 #define YDrawHV_ 0x2003
431 #define YDraw_P 0x2004
432 #define YDrawV_P 0x2006
433 #define YDrawH_P 0x2005
434 #define YDrawVH_P 0x2007
435 #define YDrawHV_P 0x2007
436 
437 #define YDraw_I (0x2000 | dImage_)
438 #define YDrawV_I (0x2002 | dImage_)
439 #define YDrawH_I (0x2001 | dImage_)
440 #define YDrawVH_I (0x2003 | dImage_)
441 #define YDrawHV_I (0x2003 | dImage_)
442 #define YDraw_PI (0x2004 | dImage_)
443 #define YDrawV_PI (0x2006 | dImage_)
444 #define YDrawH_PI (0x2005 | dImage_)
445 #define YDrawVH_PI (0x2007 | dImage_)
446 #define YDrawHV_PI (0x2007 | dImage_)
447 
448 /*----------------------------------------------------------------------*/
449 #define dShowValue 0x0004
450 #define YScale_ 0x5000
451 #define YScaleU_ (YScale_ | dUserRes)
452 #define YScaleH_ (YScale_ | dHor)
453 #define YScaleV_ (YScale_ | dVer)
454 
455 #define YScale_L (YScale_ | dLeft)
456 #define YScaleH_L (YScale_ | dHor | dLeft)
457 #define YScaleV_L (YScale_ | dVer | dLeft)
458 
459 #define YScale_R (YScale_ | dRight)
460 #define YScaleH_R (YScale_ | dHor | dRight)
461 #define YScaleV_R (YScale_ | dVer | dRight)
462 
463 #define YScale_RL (YScale_ | dRight | dLeft)
464 #define YScaleH_RL (YScale_ | dHor | dRight | dLeft)
465 #define YScaleV_RL (YScale_ | dVer | dRight | dLeft)
466 
467 #define YScale_D (YScale_ | dDown)
468 #define YScaleH_D (YScale_ | dHor | dDown)
469 #define YScaleV_D (YScale_ | dVer | dDown)
470 
471 /*----------------------------------------------------------------------*/
472 #define dArrow 0x04
473 #define dDrawSB_ 0x08
474 #define YScrollBar_ 0x4000
475 #define YScrollBarH_ (YScrollBar_ | dHor)
476 #define YScrollBarV_ (YScrollBar_ | dVer)
477 
478 #define YScrollBar_L (YScrollBar_ | dLeft)
479 #define YScrollBarH_L (YScrollBar_ | dHor | dLeft)
480 #define YScrollBarV_L (YScrollBar_ | dVer | dLeft)
481 
482 #define YScrollBar_R (YScrollBar_ | dRight)
483 #define YScrollBarH_R (YScrollBar_ | dHor | dRight)
484 #define YScrollBarV_R (YScrollBar_ | dVer | dRight)
485 
486 #define YScrollBar_RL (YScrollBar_ | dRight | dLeft)
487 #define YScrollBarH_RL (YScrollBar_ | dHor | dRight | dLeft)
488 #define YScrollBarV_RL (YScrollBar_ | dVer | dRight | dLeft)
489 
490 #define YScrollBar_D (YScrollBar_ | dDown)
491 #define YScrollBarH_D (YScrollBar_ | dHor | dDown)
492 #define YScrollBarV_D (YScrollBar_ | dVer | dDown)
493 
494 /*----------------------------------------------------------------------*/
495 #define YSeparator_ 0x8000
496 #define YSeparatorH_ (YSeparator_ | dHor)
497 #define YSeparatorV_ (YSeparator_ | dVer)
498 
499 #define YSeparator_L (YSeparator_ | dLeft)
500 #define YSeparatorH_L (YSeparator_ | dHor | dLeft)
501 #define YSeparatorV_L (YSeparator_ | dVer | dLeft)
502 
503 #define YSeparator_R (YSeparator_ | dRight)
504 #define YSeparatorH_R (YSeparator_ | dHor | dRight)
505 #define YSeparatorV_R (YSeparator_ | dVer | dRight)
506 
507 #define YSeparator_RL (YSeparator_ | dRight | dLeft)
508 #define YSeparatorH_RL (YSeparator_ | dHor | dRight | dLeft)
509 #define YSeparatorV_RL (YSeparator_ | dVer | dRight | dLeft)
510 
511 #define YSeparator_D (YSeparator_ | dDown)
512 #define YSeparatorH_D (YSeparator_ | dHor | dDown)
513 #define YSeparatorV_D (YSeparator_ | dVer | dDown)
514 
515 /*----------------------------------------------------------------------*/
516 #define YActivate 0x4001
517 #define YLoose 0x4002
518 #define YArm 0x4003
519 #define YEnter 0x4004
520 #define YDisArm 0x4005
521 #define YFocus 0x4006
522 #define YMove 0x4007
523 #define YSelect 0x4008
524 #define YExpose 0x4009
525 #define YInput 0x400a
526 #define YResize 0x400b
527 #define YClick 0x400c
528 #define YChanged 0x400d
529 #define YEsc 0x400e
530 #define YCancel 0x400e
531 #define YZoom 0x400f
532 #define YOk 0x4010
533 #define YApply 0x4011
534 #define YHelp 0x4012
535 #define YInitZoom 0x4013
536 #define YTimeOut 0x4014
537 #define YClient 0x4015
538 #define YNewClient 0x4016
539 #define YKillClient 0x4017
540 #define YResizeR 0x4018
541 #define YModify 0x4019
542 #define YRefresh 0x401a
543 #define YCreate 0x401b
544 #define YPrimLoose 0x401c
545 #define YPrimFocus 0x401d
546 #define YDragScale 0x401e
547 #define YCopy 0x401f
548 #define YXorExpose 0x4020
549 #define YLoad 0x4021
550 #define YSave 0x4022
551 #define YDrag 0x4023
552 
553 #define YIncrementV 0x01
554 #define YDecrementV 0x02
555 #define YChangedV 0x03
556 #define YDragV 0x04
557 #define YIncrementH 0x11
558 #define YDecrementH 0x12
559 #define YChangedH 0x13
560 #define YDragH 0x14
561 
562 
563 /*----------------------------------------------------------------------------*/
564 typedef struct
565  {
566  unsigned char* data_name; /* data or filename for icon */
567  char* icon_name;
568  short icon_file, icon_depth;
569  short icon_width,icon_height;
570  Pixmap icon_pixmap;
571  int icon_count;
572  } YIcon;
573 
574 typedef struct
575  {
576  YIcon Icon;
577  int fg,count;
578  Window win;
579  GC gc;
580  } YIconTitle;
581 
582 typedef struct
583  {
584  int type;
585  char* name;
586  short res;
587  CallB cb;
588  Widget w; /* return creating widget */
589  } YUnion;
590 
591 typedef struct
592  {
593  int type;
594  char* name;
595  short res;
596  CallB cb;
597  Widget w; /* return creating widget */
598  short KeyIn,KeyOut;
599  YIcon* I; /* structure for icon */
600  } YButton;
601 
602 typedef struct
603  {
604  int type;
605  char* name;
606  short res;
607  CallB cb;
608  Widget w; /* return creating widget */
609  short KeyIn,KeyOut;
610  YIcon* I; /* structure for icon */
611  short n;
612  void** T;
613  } YButtonC;
614 
615 typedef struct
616  {
617  int type;
618  char* name;
619  short res;
620  CallB cb;
621  Widget w;
622  int value;
623  int minimum;
624  int maximum;
625  int slider_size;
626  int increment;
627  int page_increment;
628  void* user;
629  } YScrollBar;
630 
631 typedef struct
632  {
633  int type;
634  char* name;
635  short res;
636  CallB cb;
637  Widget w;
638  int value;
639  int minimum;
640  int maximum;
641  short thickness,length;
642  int increment;
643  int decimalPoints;
644  void* user;
645  } YScale;
646 
648 
649 typedef struct
650  {
651  int type;
652  char* name;
653  short res;
654  CallB cb;
655  Widget w; /* return creating widget*/
656  short width;
657  short height;
658  char* fontname;
659  GC gc;
660  void* usr;
661  Window win;
662  XFontStruct* font;
663  short ch_w, ch_h;
664  short x,y;
665  int x_root, y_root; /* coordinates relative to root */
666  unsigned int eType, keycode; /* detail */
667  int foreground, background;
668 /*signed */char mode,clip,WinDraw,CgmDraw;
669  YScrollBar Vs;
670  YScrollBar Hs;
671  XEvent* Draw_event;
672  Pixmap pixmap;
673  XImage* image;
674  int cyrsor_type;
675  Cursor cursor;
676  short x1, y1, w1, h1; /* Clip box */
677  short count,key; /* Not use it */
678  void* vol; /* Not use it */
679  int CgmWidth,CgmHeight,CgmX,CgmY;
680  int ScreenId; /* !vlad! */
681 } YDraw;
682 
683 typedef struct
684  {
685  int type;
686  char* name;
687  short res;
688  Widget w; /* return creating widget*/
689  YIcon* I; /* structure for icon */
690  } YLabel;
691 
692 typedef struct
693  {
694  int type;
695  char* name;
696  short res;
697  CallB cb;
698  Widget w; /* return creating widget*/
699  short len;
700  } YText;
701 
702 typedef struct
703  {
704  int type;
705  char* name;
706  short res;
707  CallB cb;
708  Widget w; /* return creating widget*/
709  short rows,columns;
710  short c_row,c_col;
711  char* buf;
712  } YTextW;
713 
714 typedef struct
715  {
716  int type;
717  char* name;
718  short res;
719  CallB cb;
720  Widget w; /* return creating widget*/
721  short len;
722  short maxlen;
723  char* value;
724  } YTextC;
725 #define YTextS YTextC
726 
727 typedef struct
728  {
729  int type;
730  char* name;
731  short res;
732  CallB cb;
733  Widget w; /* return creating widget*/
734  short len;
735  PrnText P;
736  float value;
737  float minv;
738  float maxv;
739  Widget s;
740  } YTextI;
741 
742 typedef struct
743  {
744  int type;
745  char* name;
746  short res;
747  CallB cb;
748  Widget w; /* return creating widget*/
749  short len;
750  PrnText P;
751  float value;
752  float minv;
753  float maxv;
754  Widget s;
755  } YTextF;
756 
757 typedef struct
758  {
759  int type;
760  char* name;
761  short res;
762  short n;
763  Widget w; /* return creating widget*/
764  void** T;
765  } YFrame;
766 
767 typedef struct
768  {
769  int type;
770  char* name;
771  short res;
772  short n;
773  Widget w; /* return creating widget*/
774  void** T;
775  short row;
776  } YFrameR;
777 
778 typedef struct
779  {
780  int type;
781  char* name;
782  short res;
783  short thickness,width,height;
784  Widget w;
785  } YSeparator;
786 
787 typedef struct
788  {
789  int type;
790  char* name;
791  short res;
792  short n;
793  Widget w; /* return creating widget*/
794  void** F;
795  YIcon* I; /* structure for icon */
796  Widget form;
797  } YMnstr;
798 /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
799 
800 typedef struct
801  {
802  int type;
803  char* name;
804  short res;
805  CallB cb;
806  Widget w; /* return creating widget*/
807  short KeyIn,KeyOut;
808  YIcon* I; /* structure for icon */
809  Arg* args;
810  } YrButton;
811 
812 typedef struct
813  {
814  int type;
815  char* name;
816  short res;
817  CallB cb;
818  Widget w; /* return creating widget*/
819  short KeyIn,KeyOut;
820  YIcon* I; /* structure for icon */
821  Arg* args;
822  short n;
823  void** T;
824  } YrButtonC;
825 
826 typedef struct
827  {
828  int type;
829  char* name;
830  short res;
831  CallB cb;
832  Widget w;
833  int value;
834  int minimum;
835  int maximum;
836  int slider_size;
837  int increment;
838  int page_increment;
839  void* user;
840  Arg* args;
841  } YrScrollBar;
842 
843 typedef struct
844  {
845  int type;
846  char* name;
847  short res;
848  CallB cb;
849  Widget w;
850  int value;
851  int minimum;
852  int maximum;
853  short thickness,length;
854  int increment;
855  int decimalPoints;
856  void* user;
857  Arg* args;
858  } YrScale;
859 
860 typedef struct
861  {
862  int type;
863  char* name;
864  short res;
865  CallB cb;
866  Widget w; /* return creating widget*/
867  short width;
868  short height;
869  char* fontname;
870  GC gc;
871  void* usr;
872  Window win;
873  XFontStruct* font;
874  short ch_w, ch_h;
875  short x,y;
876  int x_root, y_root; /* coordinates relative to root */
877  unsigned int eType, keycode; /* detail */
878  int foreground, background;
879  char mode,clip,WinDraw,PixmapDraw;
880  YScrollBar Vs;
881  YScrollBar Hs;
882  XEvent* Draw_event;
883  Pixmap pixmap;
884  XImage* image;
885  int cyrsor_type;
886  Cursor cursor;
887  short x1, y1, w1, h1; /* Clip box */
888  short count,key; /* Not use it */
889  void* vol; /* Not use it */
890  int CgmWidth,CgmHeight,CgmX,CgmY;
891  Arg* args;
892 } YrDraw;
893 
894 typedef struct
895  {
896  int type;
897  char* name;
898  short res;
899  Widget w; /* return creating widget*/
900  YIcon* I; /* structure for icon */
901  Arg* args;
902  } YrLabel;
903 
904 typedef struct
905  {
906  int type;
907  char* name;
908  short res;
909  CallB cb;
910  Widget w; /* return creating widget*/
911  short len;
912  Arg* args;
913  } YrText;
914 
915 typedef struct
916  {
917  int type;
918  char* name;
919  short res;
920  CallB cb;
921  Widget w; /* return creating widget*/
922  short rows,columns;
923  short c_row,c_col;
924  char* buf;
925  Arg* args;
926  } YrTextW;
927 
928 typedef struct
929  {
930  int type;
931  char* name;
932  short res;
933  CallB cb;
934  Widget w; /* return creating widget*/
935  short len;
936  short maxlen;
937  char* value;
938  Arg* args;
939  } YrTextC;
940 #define YrTextS YrTextC
941 
942 typedef struct
943  {
944  int type;
945  char* name;
946  short res;
947  CallB cb;
948  Widget w; /* return creating widget*/
949  short len;
950  PrnText P;
951  float value;
952  float minv;
953  float maxv;
954  Widget s;
955  Arg* args;
956  } YrTextI;
957 
958 typedef struct
959  {
960  int type;
961  char* name;
962  short res;
963  CallB cb;
964  Widget w; /* return creating widget*/
965  short len;
966  PrnText P;
967  float value;
968  float minv;
969  float maxv;
970  Widget s;
971  Arg* args;
972  } YrTextF;
973 
974 typedef struct
975  {
976  int type;
977  char* name;
978  short res;
979  short n;
980  Widget w; /* return creating widget*/
981  void** T;
982  Arg* args;
983  } YrFrame;
984 
985 typedef struct
986  {
987  int type;
988  char* name;
989  short res;
990  short n;
991  Widget w; /* return creating widget*/
992  void** T;
993  short row;
994  Arg* args;
995  } YrFrameR;
996 
997 typedef struct
998  {
999  int type;
1000  char* name;
1001  short res;
1002  short thickness,width,height;
1003  Widget w;
1004  Arg* args;
1005  } YrSeparator;
1006 
1007 typedef struct
1008  {
1009  int type;
1010  char* name;
1011  short res;
1012  short n;
1013  Widget w; /* return creating widget*/
1014  void** F;
1015  YIcon* I; /* structure for icon */
1016  Widget form;
1017  Arg* args;
1018  } YrMnstr;
1019 typedef union
1020  {
1021  int type;
1022  YUnion Un;
1023  YText Text;
1024  YTextS TextS;
1025  YTextI TextI;
1026  YTextF TextF;
1027  YTextW TextW;
1028  YButton Button;
1029  YButtonC ButtonC;
1030  YLabel Label;
1031  YFrame Frame;
1032  YFrameR FrameR;
1033  YDraw Draw;
1034  YScrollBar ScrollBar;
1035  YScale Scale;
1036  YSeparator Separator;
1037  YMnstr Mnstr;
1038 
1039  YrText rText;
1040  YrTextS rTextS;
1041  YrTextI rTextI;
1042  YrTextF rTextF;
1043  YrTextW rTextW;
1044  YrButton rButton;
1045  YrButtonC rButtonC;
1046  YrLabel rLabel;
1047  YrFrame rFrame;
1048  YrFrameR rFrameR;
1049  YrDraw rDraw;
1050  YrScrollBar rScrollBar;
1051  YrScale rScale;
1052  YrSeparator rSeparator;
1053  YrMnstr rMnstr;
1054  } YType;
1055 
1056 #define DLabel(var, type,name,res, Ic) \
1057  YLabel var = {YLabel_|type,name,res,0,Ic}
1058 
1059 #define DrLabel(var, type,name,res, Ic,args) \
1060  YrLabel var = {YLabel_|dUserRes|type,name,res,0,Ic,args}
1061 
1062 #define DTextF(var, type,name,res,cb, len,P,value,minv,maxv) \
1063  YTextF var = {YTextF_|type,name,res,cb,0,len,P,value,minv,maxv}
1064 
1065 #define DrTextF(var, type,name,res,cb, len,P,value,minv,maxv, args) \
1066  YrTextF var = {YTextFU_|type,name,res,cb,0,len,P,value,minv,maxv,0,args}
1067 
1068 #define DTextC( var, type,name,res,cb, len,maxlen,value) \
1069  YTextC var = {YTextC_|type,name,res,cb,0,len,maxlen,value}
1070 
1071 #define DrTextC(var, type,name,res,cb, len,maxlen,value,args) \
1072  YrTextC var = {YTextCU_|type,name,res,cb,0,len,maxlen,value,args}
1073 
1074 #define DTextI(var, type,name,res,cb, len,P,value,minv,maxv) \
1075  YTextI var = {YTextI_|type,name,res,cb,0,len,P,value,minv,maxv}
1076 
1077 #define DrTextI(var, type,name,res,cb, len,P,value,minv,maxv, args) \
1078  YrTextI var = {YTextIU_|type,name,res,cb,0,len,P,value,minv,maxv,0,args}
1079 
1080 #define DText(var, type,name,res,cb, len) \
1081  YText var = {YText_|type,name,res,cb,0,len}
1082 
1083 #define DrText(var, type,name,res,cb, len,args) \
1084  YrText var = {YText_|dUserRes|type,name,res,cb,0,len,args}
1085 
1086 
1087 #define DrScale(var, type,name,res,cb, val,mi,ma,thck,len,incr,d,args) \
1088  YrScale var = {YScaleU_|type,name,res,cb,0,val,mi,ma,thck,len,incr,d,args}
1089 
1090 #define DScale(var, type,name,res,cb, val,mi,ma,thck,len,incr,d) \
1091  YScale var = {YScale_|type,name,res,cb,0,val,mi,ma,thck,len,incr,d}
1092 
1093 #define DButton(var, type,name,res,cb, kIn,kOut,Ic) \
1094  YButton var = {YButton_|type,name,res,cb,0,kIn,kOut,Ic}
1095 
1096 #define DrButton(var, type,name,res,cb, kIn,kOut,Ic,args) \
1097  YButton var = {YButton_|type,name,res,cb,0,kIn,kOut,Ic,args}
1098 
1099 #define DButtonT(var, type,name,res,cb, kIn,kOut,Ic) \
1100  YButton var = {YButtonT_|type,name,res,cb,0,kIn,kOut,Ic}
1101 
1102 #define DrButtonT(var, type,name,res,cb, kIn,kOut,Ic,args) \
1103  YButton var = {YButtonT_|type,name,res,cb,0,kIn,kOut,Ic,args}
1104 
1105 #define DButtonC(var, type,name,res,cb, kIn,kOut,Ic,n,T) \
1106  YButtonC var = {YButtonC_|type,name,res,cb,0,kIn,kOut,Ic,n,T}
1107 
1108 #define DrButtonC(var, type,name,res,cb, kIn,kOut,Ic,args,n,T) \
1109  YrButtonC var = {YButtonC_|dUserRes|type,name,res,cb,0,kIn,kOut,Ic,args,n,T}
1110 
1111 #define DMnstrD(var, type,name,res,n, F,I) \
1112  YMnstr var = {YMnstrD_|type,name,res,n,0,F,I}
1113 
1114 #define DrMnstrD(var, type,name,res,n, F,I, args) \
1115  YrMnstr var = {YMnstrD_|dUserRes|type,name,res,n,0,F,I,0,args}
1116 
1117 #define DFrame(var, type,name,res,n, F) \
1118  YFrame var = {YFrame_|type,name,res,n,0,F}
1119 
1120 #define DrFrame(var, type,name,res,n, F,args) \
1121  YrFrame var = {YFrame_|dUserRes|type,name,res,n,0,F,args}
1122 
1123 #define DFrameR(var, type,name,res,n, F,row) \
1124  YFrameR var = {YFrameR_|type,name,res,n,0,F,row}
1125 
1126 #define DrFrameR(var, type,name,res,n, F,row,args) \
1127  YrFrameR var = {YFrameR_|dUserRes|type,name,res,n,0,F,row,args}
1128 
1129 
1130 #ifndef Y_UTIL
1131 #define Y_UTIL
1132 #define ClearFlag(a,f) a &= ~(f)
1133 #define SetFlag(a,f) a |= (f)
1134 #define Is(a,f) if(((a) & (f)) == (f))
1135 #define IsNo(a,f) if(((a) & (f)) != (f))
1136 #define IsNot(a,f) if(((a) & (f)) == 0)
1137 #define Cpy(a,b1) strcpy(a,b1)
1138 #define CpyCat(a,b1,b2) strcat(strcpy(a,b1),b2)
1139 #define CpyCatCat(a,b1,b2,b3) strcat(strcat(strcpy(a,b1),b2),b3)
1140 #define CpyCatCatCat(a,b1,b2,b3,b4) strcat(strcat(strcat(strcpy(a,b1),b2),b3),b4)
1141 #define Cat(a,b1) strcat(a,b1)
1142 #define CatCat(a,b1,b2) strcat(strcat(a,b1),b2)
1143 #define CatCatCat(a,b1,b2,b3) strcat(strcat(strcat(a,b1),b2),b3)
1144 #endif /*Y_UTIL*/
1145 
1146 #define YmSetValueT(a,b) YmSetValue((YType*) (a),b)
1147 #define CloseMonstr(a) YmCloseMonstr_((YType*) (a))
1148 #define YmCloseMonstr(a) YmCloseMonstr_((YType*) (a))
1149 #define KillMonstr(a) YmKillMonstr_((YType*) (a))
1150 #define YmKillMonstr(a) YmKillMonstr_((YType*) (a))
1151 #define IsMonstrKilled(a) (Boolean)YtWidget((YType*)(a))
1152 #define YtWidget(a) YtWidget_((YType*)(a))
1153 #define YmWidget(a) YtWidget_((YType*)(a))
1154 #define YtSetSensitive(t,b) YtSetSensitive_((YType*)(t),b)
1155 #define YtGetSensitive(t) YtGetSensitive_((YType*)(t))
1156 #define YmSetVisible(t,b) YmSetVisible_((YType*)(t),b)
1157 #define YmGetVisible(t) YmGetVisible_((YType*)(t))
1158 #define YmWidth(t) YmWidth_((YType*)(t))
1159 #define YmHeight(t) YmHeight_((YType*)(t))
1160 #define YmResizeMonstr(t,a,b) YmResizeMonstr_((YType*)(t),a,b)
1161 #define YmNOutKey(cb,n,a) YmNOutKey_(cb,n,(caddr_t)a)
1162 #define YmResizeParentMonstr(t,a,b) YmResizeParentMonstr_((YType*)(t),a,b)
1163 
1164 
1165 /********************* FORWARD DEFINES *********************************/
1166 #ifdef _NO_PROTO_
1167 void ChangeFileExt();
1168 char* SetStrLen();
1169 
1170 int Call_Back();
1171 int YmTimeOut();
1172 int YmNOut();
1173 int YmNOutKey_();
1174 int Get_Time();
1175 
1176 int YtMalloc();
1177 void* YtFree();
1178 void* YuFree();
1179 void* YFree();
1180 void* YmStringFree();
1181 
1182 Widget YmInitShell();
1183 Widget YmCreateMonstr();
1184 void YmCreateMonstrTime();
1185 void YmKillMonstr_();
1186 void YmCloseMonstr_();
1187 Widget YmCreateWidget();
1188 Widget CreateDialog();
1189 void YmRealizeMainMonstr();
1190 int YmResizeMonstr_();
1191 int YmResizeParentMonstr_();
1192 void YtJumpWidget();
1193 int YmUpdateDisplay();
1194 int YtUpdateFrame();
1195 int YtSetBorderValues();
1196 void YtJampWidget();
1197 int YtWidth();
1198 int YtHeight();
1199 int YmWidth_();
1200 int YmHeight_();
1201 Widget YtWidget_();
1202 
1203 int YtSetArg_ ();
1204 int YtSetArg0_();
1205 int YtSetArgPtr();
1206 int YtSetArgPtrVerify();
1207 int YtCopyArgPtr();
1208 int YtCopyArgPtrDef();
1209 int YtDeleteArg();
1210 void YtGetValues();
1211 void YtSetValues();
1212 void YtSetValuesPtr();
1213 int YtGetValuesPtr();
1214 int YtGetValuePtr();
1215 XtArgVal YtGetValue();
1216 void YtSetValue();
1217 void YtCopyWidgetValue();
1218 int YtFindArg();
1219 int YtGetValueDef();
1220 int YmSetArgDef();
1221 int YmSetArgDefName();
1222 int YtSetColorArgPtrDef();
1223 int YtGetAllResource();
1224 int YtSetResourceArg();
1225 void YmAttach();
1226 void YmAttachS();
1227 void YmNilAttach();
1228 XmString YmNlabelString ();
1229 XmString YmNacceleratorText();
1230 char* YmSetLabelName();
1231 
1232 XImage* YtCreateDefaultImage();
1233 int YtWarning(char *format, ...);
1234 void YtSetTranslation();
1235 int YtSetAction();
1236 int YtSetAction_Num();
1237 void PrintActions();
1238 
1239 void PrintValue();
1240 int YmSetValue();
1241 void YmGetTextValue();
1242 double SetNumberTextValue();
1243 void YmTypeText();
1244 int YmScrollBarGetValues();
1245 int YmScrollBarSetValues();
1246 int YmScrollBarSetValues_();
1247 Boolean YmToggleButtonGetState();
1248 int YmToggleButtonSetState();
1249 Boolean YtGetSensitive_();
1250 int YtSetSensitive_();
1251 Boolean YmGetVisible_();
1252 int YmSetVisible_();
1253 void SetWidgetColor();
1254 void YmSetColor();
1255 int YmGetColor();
1256 void YmSetColorNameRes();
1257 void YmSetInverseColorNameRes();
1258 void YmSendClientMessage();
1259 Window* YtSetOutputWindows();
1260 int YmLoadFont();
1261 int YtLoadFont();
1262 int YtLoadFont_();
1263 int FreeFontStructs();
1264 XGCValues* YmGetGCValues();
1265 int YmDeleteFontCursor();
1266 int YmCreateFontCursor();
1267 
1268 void YmTextSetCursorPosition();
1269 int YtGetWindowXY();
1270 Window YtGetParentWindow();
1271 void YGeometry();
1272 void YtSetWidgetColor();
1273 int YmButtonArmDisArm();
1274 int AddOutputWindow();
1275 int DelOutputWindow();
1276 int YErrorHandler();
1277 YType* WidgetToYType();
1278 int YtSetInputMonstr();
1279 void YmSendClientMessage();
1280 void YSendEvent();
1281 void YClientMessage();
1282 Display* YDisplay_();
1283 Screen* YScreen_();
1284 Screen* YtScreen();
1285 Window YmRootWindow_();
1286 Window YtRootWindow();
1287 GC YDefaultGC_();
1288 GC YtDefaultGC();
1289 GC ScreenDefaultGC();
1290 Window ScreenRootWindow();
1291 void YmChangeTextLabel ();
1292 void YmNoEditBorder ();
1293 
1294 #else /* _NO_PROTO_ */
1295 
1296 char* SetStrLen(char* str,int len);
1297 void ChangeFileExt(char *filename,char *ext);
1298 int Call_Back(CallB cb, int key);
1299 int YmTimeOut(CallB cb,int t);
1300 int YmNOut(CallB cb,int t);
1301 int YmNOutKey_(CallB cb,int t,caddr_t key);
1302 int Get_Time(int i);
1303 
1304 int YtMalloc(void* buf, long sz);
1305 void* YtFree(void *buf);
1306 void* YuFree(void *buf);
1307 void* YFree(void *buf);
1308 void* YmStringFree(XmString buf);
1309 
1310 Widget YmInitShell(char* name,char* resname,int argc,char **argv);
1311 Widget YmCreateMonstr(Widget parent,char* dpyName,YMnstr* ms);
1312 void YmCreateMonstrTime(Widget parent,char* dpyName,YMnstr* t);
1313 void YmKillMonstr_(YType* m);
1314 void YmCloseMonstr_(YType* t);
1315 Widget YmCreateWidget(Widget parent,int parentType,YType* t);
1316 Widget CreateDialog(Widget parent,char *name);
1317 void YmRealizeMainMonstr(YMnstr* t);
1318 int YmResizeMonstr_(YType* t,int width,int height);
1319 int YmResizeParentMonstr_(YType* t,int width,int height);
1320 void YtJumpWidget(YType* t);
1321 int YmUpdateDisplay(YType* t);
1322 int YtUpdateFrame(YFrame* fr,YMnstr* mn);
1323 int YtSetBorderValues(Widget w,int shadowTyp,int shadowTh,
1324  int borderW, int highlightTh);
1325 void YtJampWidget(YType* t);
1326 int YtWidth(Widget w);
1327 int YtHeight(Widget w);
1328 int YmWidth_(YType* t);
1329 int YmHeight_(YType* t);
1330 Widget YtWidget_(YType* t);
1331 
1332 int YtSetArg_ (char* name,XtArgVal d);
1333 int YtSetArg0_(char* name,XtArgVal d);
1334 int YtSetArgPtr(Yres* res,char* name,XtArgVal value);
1335 int YtSetArgPtrVerify(Yres* res,char* name,XtArgVal value);
1336 int YtCopyArgPtr(Yres* yr1,Yres* yr2,char *name1,char *name2);
1337 int YtCopyArgPtrDef(Yres* yr1,int defname,char *name1,char *name2);
1338 int YtDeleteArg(char* name);
1339 void YtGetValues(Widget w);
1340 void YtSetValues(Widget w);
1341 void YtSetValuesPtr(Widget w,Yres* res);
1342 int YtGetValuesPtr(Widget w,Yres* res);
1343 int YtGetValuePtr(Yres* yr2,char *name,XtArgVal* val);
1344 XtArgVal YtGetValue(Widget w,char* name);
1345 void YtSetValue(Widget w, char* name, XtArgVal value);
1346 void YtCopyWidgetValue(Widget w,char* name1,char* name2);
1347 int YtFindArg(char* name1,char* name2,int nname);
1348 int YtGetValueDef(int defname,char *name,XtArgVal* val);
1349 int YmSetArgDef(YType* t);
1350 int YmSetArgDefName(int res,int OnlyColor);
1351 int YtSetColorArgPtrDef(Yres* yr,int nname);
1352 int YtGetAllResource(Widget parent);
1353 int YtSetResourceArg(int nname);
1354 void YmAttach(Widget L,Widget T,Widget R,Widget B,
1355  int sl,int st,int sr,int sb);
1356 void YmAttachS( ATTACH_OBJ *att);
1357 void YmNilAttach(void);
1358 XmString YmNlabelString (char *label,int mnemonic);
1359 XmString YmNacceleratorText(char* accel_name,char* accel_key);
1360 char* YmSetLabelName(char* name);
1361 
1362 XImage* YtCreateDefaultImage(char *bits,int width,int height);
1363 int YtWarning(char *format, ...);
1364 void YtSetTranslation(
1365  Widget w, char* app_name, char* key_sym, XtActionProc proc);
1366 int YtSetAction(Widget w,char *name,char *sym);
1367 int YtSetAction_Num(Widget w,char *name,char *sym,int i);
1368 void PrintActions(Widget w);
1369 
1370 void YmNoEditBorder (YType* t);
1371 void YmChangeTextLabel (YType* t, char* str);
1372 
1373 void PrintValue(YType* t,double val);
1374 int YmSetValue(YType* t,void* value);
1375 void YmGetTextValue(YType* t);
1376 double SetNumberTextValue(YType* t,double value);
1377 void YmTypeText(Widget w,char* str);
1378 int YmScrollBarGetValues(YScrollBar* s);
1379 int YmScrollBarSetValues(YScrollBar* s);
1380 int YmScrollBarSetValues_(YScrollBar* s,
1381  int minimum,int maximum,int value,
1382  int slider_size,int increment,int page_increment);
1383 Boolean YmToggleButtonGetState(YType* t);
1384 int YmToggleButtonSetState(YType* t,int state);
1385 Boolean YtGetSensitive_(YType* t);
1386 int YtSetSensitive_(YType* t,int state);
1387 Boolean YmGetVisible_(YType* t);
1388 int YmSetVisible_(YType* t,int b);
1389 void SetWidgetColor(Widget w, int name);
1390 void YmSetColor(YType* t, int foreground,int background);
1391 int YmGetColor(YType* t, int *foreground,int *background);
1392 void YmSetColorNameRes(YType* t, int name);
1393 void YmSetInverseColorNameRes(YType* t, int name);
1394 void YmSendClientMessage(void* data,int type,Window* win,int nn);
1395 Window* YtSetOutputWindows(char* Wname[],int n,int *nn);
1396 int YmLoadFont(YType* t,char *FontName);
1397 int YtLoadFont(Widget w,char *FontName);
1398 int YtLoadFont_(char* FontName,int dr);
1399 int FreeFontStructs(void);
1400 XGCValues* YmGetGCValues(GC gc);
1401 int YmDeleteFontCursor(YDraw* yd);
1402 int YmCreateFontCursor(YDraw* yd,int cyrsor_type);
1403 
1404 void YmTextSetCursorPosition(Widget w, XmTextPosition p);
1405 int YtGetWindowXY(Window win,int *x,int *y);
1406 Window YtGetParentWindow(Display* dpy,Window win);
1407 void YGeometry(Widget w,int type);
1408 void YtSetWidgetColor(Widget w, int fg,int bg);
1409 int YmButtonArmDisArm(YType* t);
1410 int AddOutputWindow(Window win);
1411 int DelOutputWindow(Window win);
1412 int YErrorHandler(Display* disp,XErrorEvent* er);
1413 YType* WidgetToYType(Widget w);
1414 int YtSetInputMonstr(YType* t);
1415 void YmSendClientMessage(void* data,int type,Window* win,int nn);
1416 void YSendEvent(int type,int keycode,int x,int y);
1417 
1418 Display* YDisplay_(YType* t);
1419 Screen* YScreen_(YType* t);
1420 Screen* YtScreen(Widget w);
1421 Window YmRootWindow_(YType* t);
1422 Window YtRootWindow(Widget w);
1423 Window ScreenRootWindow(Screen* scr);
1424 GC YDefaultGC_(YType* t);
1425 GC YtDefaultGC(Widget w);
1426 GC ScreenDefaultGC(Screen* scr);
1427 
1428 void YClientMessage(
1429  Widget w,char* name,Atom a, int format, EventMask mask);
1430 void YmChangeTextLabel (YType* t, char* str);
1431 void YmNoEditBorder (YType* t);
1432 
1433 #endif /* _NO_PROTO_ */
1434 
1435 #define Screen_N 4
1436 #define YtDisplay(w) XtDisplay(w)
1437 #define YDisplay(t) YDisplay_((YType*) t)
1438 #define YmDisplay(t) YDisplay_((YType*) t)
1439 
1440 #define YScreen(t) YScreen_((YType*) t)
1441 #define YmScreen_(t) YScreen_((YType*) t)
1442 
1443 #define YmRootWindow(t) YmRootWindow_((YType*) t)
1444 
1445 #define YDefaultGC(t) YDefaultGC_((YType*) t)
1446 #define YmDefaultGC(t) YDefaultGC_((YType*) t)
1447 /********************** External var ************************************/
1448 
1449 extern int ScreenId;
1450 extern XtAppContext app_context; /* Application Context */
1451 extern Display* display;
1452 extern Colormap Ycmap;
1453 extern XEvent YEvent;
1454 extern XKeyEvent* TB_event;
1455 extern char* YTextPntr;
1456 extern int YTextLength;
1457 extern Window YRootWindow;
1458 extern short YRootWidth,YRootHeight;
1459 extern int YRootForeground,YRootBackground;
1460 extern GC YRootGC;
1461 extern int YDefaultScreen;
1462 extern Menu_struct Menu_env;
1463 extern Widget Top_level;
1464 extern Widget YMenu_Bar;
1465 extern Widget ButtonW;
1466 extern YType* MnstrD;
1467 extern YDraw* Draw_s;
1468 extern XEvent* Draw_event;
1469 extern Window Draw_win;
1470 extern int Ykey;
1471 extern YScrollBar* Draw_Sc;
1472 extern char* YmFontName;
1473 extern YSeparator Sep1;
1474 extern YSeparator Sep2;
1475 extern Arg NilBord[];
1476 extern XClientMessageEvent* YClientEvent;
1477 /*
1478 extern Arg Yarg[];
1479 extern Cardinal Yi;
1480 */
1481 
1482 extern Yres GRes;
1483 #define Yarg GRes.arg
1484 #define Yi GRes.i
1485 
1486 /***********************************************************************/
1487 #endif /* _YMPROG_H */
Definition: ymprog.h:894
Definition: ymprog.h:800
Definition: ymprog.h:158
Definition: ymprog.h:787
Definition: ymprog.h:692
Definition: ymprog.h:826
Definition: ymprog.h:985
Definition: ymprog.h:843
Definition: ymprog.h:714
Definition: ymprog.h:1019
Definition: ymprog.h:615
Definition: ymprog.h:683
Definition: ymprog.h:574
Definition: ymprog.h:928
Definition: ymprog.h:812
Definition: ymprog.h:582
Definition: ymprog.h:631
Definition: ymprog.h:742
Definition: ymprog.h:860
Definition: ymprog.h:974
Definition: ymprog.h:767
Definition: ymprog.h:727
Definition: ymprog.h:958
Definition: ymprog.h:702
Definition: ymprog.h:591
Definition: ymprog.h:101
Definition: ymprog.h:649
Definition: ymprog.h:564
Definition: ymprog.h:997
Definition: ymprog.h:135
Definition: ymprog.h:165
Definition: ymprog.h:602
Definition: ymprog.h:904
Definition: ymprog.h:757
Definition: ymprog.h:942
Definition: ymprog.h:1007
Definition: ymprog.h:778
Definition: ymprog.h:915