2 static char Xrcsid
[] = "$XConsortium: Vendor.c,v 1.12 89/12/05 14:42:09 swick Exp $";
3 /* $oHeader: Vendor.c,v 1.3 88/08/19 13:11:01 asente Exp $ */
6 /***********************************************************
7 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
8 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
12 Permission to use, copy, modify, and distribute this software and its
13 documentation for any purpose and without fee is hereby granted,
14 provided that the above copyright notice appear in all copies and that
15 both that copyright notice and this permission notice appear in
16 supporting documentation, and that the names of Digital or MIT not be
17 used in advertising or publicity pertaining to distribution of the
18 software without specific, written prior permission.
20 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
21 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
22 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
23 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
24 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
28 ******************************************************************/
31 * This is a copy of Xt/Vendor.c with an additional ClassInitialize
32 * procedure to register Xmu resource type converters.
36 /* Make sure all wm properties can make it out of the resource manager */
41 #include <X11/IntrinsicP.h>
42 #include <X11/StringDefs.h>
43 #include <X11/Shell.h>
44 #include <X11/ShellP.h>
45 #include <X11/Vendor.h>
46 #include <X11/VendorP.h>
47 #include <X11/Xmu/Converters.h>
50 static XtResource resources
[] = {
51 {XtNinput
, XtCInput
, XtRBool
, sizeof(Bool
),
52 XtOffsetOf(VendorShellRec
, wm
.wm_hints
.input
),
53 XtRImmediate
, (XtPointer
)True
}
56 /***************************************************************************
58 * Vendor shell class record
60 ***************************************************************************/
62 static void _VendorShellClassInitialize();
63 static void _VendorShellInitialize();
64 static Boolean
_VendorShellSetValues();
65 static void Realize(), ChangeManaged();
67 #define SuperClass (&wmShellClassRec)
68 externaldef(vendorshellclassrec
) VendorShellClassRec vendorShellClassRec
= {
70 /* superclass */ (WidgetClass
)SuperClass
,
71 /* class_name */ "VendorShell",
72 /* size */ sizeof(VendorShellRec
),
73 /* class_initialize */ _VendorShellClassInitialize
,
74 /* class_part_initialize*/ NULL
,
75 /* Class init'ed ? */ FALSE
,
76 /* initialize */ _VendorShellInitialize
,
77 /* initialize_hook */ NULL
,
78 /* realize */ Realize
,
81 /* resources */ resources
,
82 /* resource_count */ XtNumber(resources
),
83 /* xrm_class */ NULLQUARK
,
84 /* compress_motion */ FALSE
,
85 /* compress_exposure */ TRUE
,
86 /* compress_enterleave*/ FALSE
,
87 /* visible_interest */ FALSE
,
89 /* resize */ XtInheritResize
,
91 /* set_values */ _VendorShellSetValues
,
92 /* set_values_hook */ NULL
,
93 /* set_values_almost */ XtInheritSetValuesAlmost
,
94 /* get_values_hook */ NULL
,
95 /* accept_focus */ NULL
,
96 /* intrinsics version */ XtVersion
,
97 /* callback offsets */ NULL
,
99 /* query_geometry */ NULL
,
100 /* display_accelerator*/ NULL
,
103 /* geometry_manager */ XtInheritGeometryManager
,
104 /* change_managed */ ChangeManaged
,
105 /* insert_child */ XtInheritInsertChild
,
106 /* delete_child */ XtInheritDeleteChild
,
117 externaldef(vendorshellwidgetclass
) WidgetClass vendorShellWidgetClass
=
118 (WidgetClass
) (&vendorShellClassRec
);
120 static void _VendorShellClassInitialize()
122 static XtConvertArgRec screenConvertArg
[] = {
123 {XtWidgetBaseOffset
, (caddr_t
) XtOffset(Widget
, core
.screen
),
127 XtAddConverter("String", "Cursor", XmuCvtStringToCursor
,
128 screenConvertArg
, XtNumber(screenConvertArg
));
130 XtAddConverter("String", "Bitmap", XmuCvtStringToBitmap
,
131 screenConvertArg
, XtNumber(screenConvertArg
));
135 static void _VendorShellInitialize(req
, new)
141 static Boolean
_VendorShellSetValues(old
, ref
, new)
142 Widget old
, ref
, new;
147 static void Realize(wid
, vmask
, attr
)
150 XSetWindowAttributes
*attr
;
152 WidgetClass super
= wmShellWidgetClass
;
154 /* Make my superclass do all the dirty work */
156 (*super
->core_class
.realize
) (wid
, vmask
, attr
);
159 static void ChangeManaged(wid
)
162 ShellWidget w
= (ShellWidget
) wid
;
166 (*SuperClass
->composite_class
.change_managed
)(wid
);
167 for (i
= w
->composite
.num_children
, childP
= w
->composite
.children
;
169 if (XtIsManaged(*childP
)) {
170 XtSetKeyboardFocus(wid
, *childP
);