2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * $XConsortium: WObject.cc /main/3 1996/06/11 17:03:32 cde-hal $
26 * Copyright (c) 1991 HaL Computer Systems, Inc. All rights reserved.
27 * UNPUBLISHED -- rights reserved under the Copyright Laws of the United
28 * States. Use of a copyright notice is precautionary only and does not
29 * imply publication or disclosure.
31 * This software contains confidential information and trade secrets of HaL
32 * Computer Systems, Inc. Use, disclosure, or reproduction is prohibited
33 * without the prior express written permission of HaL Computer Systems, Inc.
35 * RESTRICTED RIGHTS LEGEND
36 * Use, duplication, or disclosure by the Government is subject to
37 * restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in
38 * Technical Data and Computer Software clause at DFARS 252.227-7013.
39 * HaL Computer Systems, Inc.
40 * 1315 Dell Avenue, Campbell, CA 95008
44 // This is only for the doc
48 Every widget inherits from the class \typ{WObject}.
52 The basic cast constructor for C++ widgets.
54 WObject :: WObject (Widget w)
60 The copy constructor for C++ widgets.
62 WObject :: WObject (WObject& w)
68 The basic constructor for C++ widgets. Used by every subclasses.
70 WObject :: WObject (WComposite& super, WidgetClass c, const char* name, ArgList args, Cardinal card)
72 widget = XtCreateWidget (name, c, super.widget, args, card);
76 The cast operator, to get a C widget from a C++ widget.
78 WObject :: operator Widget () const
84 Return the class of the widget.
87 WObject :: WidgetClass Class () const
89 return XtClass (widget);
93 The \fun{XtRealize} function.
96 WObject :: Realize () const
98 XtRealizeWidget (widget);
102 The \fun{XtUnrealizeWidget} function.
105 WObject :: Unrealize () const
107 XtUnrealizeWidget (widget);
111 The \fun{XtIsRealized} function.
114 WObject :: IsRealized () const
116 return XtIsRealized (widget);
120 The \fun{XtDestroyWidget} function.
121 {\em Beware to delete the C++ object after calling this method}.
124 WObject :: Destroy () const
126 XtDestroyWidget (widget);
130 Get one resource value. Equivalent of \fun{XtGetValues} with one
134 WObject :: Get (Arg& a) const
136 XtGetValues (widget, &a, 1);
142 WObject :: _Get (Arg& a) const
144 XtGetValues (widget, &a, 1);
150 WObject :: Get (ArgList a, Cardinal c) const
152 XtGetValues (widget, a, c);
156 The \fun{XtGetValues} function.
159 WObject :: Get (WArgList& w) const
164 Set one resource value. Equivalent of \fun{XtSetValues} with one
168 WObject :: Set (Arg& a) const
170 XtSetValues (widget, &a, 1);
176 WObject :: _Set (Arg& a) const
178 XtSetValues (widget, &a, 1);
184 WObject :: Set (ArgList a, Cardinal c) const
186 XtSetValues (widget, a, c);
190 The \fun{XtSetValues} function.
193 WObject :: Set (WArgList& w) const
198 The \fun{XtAddCallback} function.
201 WObject :: AddCallback (const char* name, XtCallbackProc proc, caddr_t closure) const
203 XtAddCallback (widget, name, proc, closure);
207 The \fun{XtRemoveCallback} function.
210 WObject :: RemoveCallback (const char* name, XtCallbackProc proc, caddr_t closure) const
212 XtRemoveCallback (widget, name, proc, closure);
216 The \fun{XtAddCallbacks} function.
219 WObject :: AddCallbacks (const char* name, XtCallbackList callbacks) const
221 XtAddCallbacks (widget, name, callbacks);
225 The \fun{XtRemoveCallbacks} function.
228 WObject :: RemoveCallbacks (const char* name, XtCallbackList callbacks) const
230 XtRemoveCallbacks (widget, name, callbacks);
234 The \fun{XtRemoveAllCallbacks} function.
237 WObject :: RemoveAllCallbacks (const char* name) const
239 XtRemoveAllCallbacks (widget, name);
243 The \fun{XtCallCallbacks} function.
246 WObject :: CallCallbacks (const char* name, caddr_t call_data) const
248 XtCallCallbacks (widget, name, call_data);
253 WObject :: SetCallback (const char* name, WWL* obj, WWL_FUN fun)
255 return new WCallback (*this, name, obj, fun);
259 #include <WWL/WComposite.h>
262 #define NL << '\n'; cout.flush()
264 WObject :: WObject (const WComposite& super, WidgetClass c, const char* name,
265 ArgList args, Cardinal card)
267 // cout << "Creating widget " << name << " with " << card << " args." NL;
268 widget = XtCreateWidget (name, c, super.widget, args, card);
271 WObject :: WObject (const WComposite& super, int automanage, WidgetClass c,
272 const char* name, ArgList args, Cardinal card)
275 widget = XtCreateManagedWidget (name, c, super.widget, args, card);
278 WObject :: WObject (const WComposite& super, Boolean popup, WidgetClass c,
279 const char* name, ArgList args, Cardinal card)
282 widget = XtCreatePopupShell(name, c, super.widget, args, card);
284 widget = XtCreateWidget (name, c, super.widget, args, card);