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 libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
24 * $TOG: WObject.h /main/6 1997/12/29 10:29:50 bill $
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 code is automatically generated in -*- C++ -*-
49 #include <X11/Object.h>
56 inline WObject () { widget = NULL; }
57 inline WObject (Widget w) {
60 inline WObject (const WObject& w) {
63 WObject (const WComposite& super, WidgetClass c,
64 const char* name = NULL, ArgList args = NULL,
66 WObject (const WComposite& super, int automanage,
67 WidgetClass c, const char* name = NULL,
68 ArgList args = NULL, Cardinal card = 0);
69 WObject (const WComposite& super, Boolean popup, WidgetClass c,
70 const char* name = NULL, ArgList args = NULL,
73 inline operator Widget () const { return widget; }
75 inline int operator== (int i) { return (Widget)(size_t)i == widget; }
76 inline int operator!= (int i) { return (Widget)(size_t)i != widget; }
78 inline WObject &operator = (const Widget w) { widget = w; return *this; }
79 inline WidgetClass Class () const { return XtClass (widget); }
80 inline void Realize () const { XtRealizeWidget (widget); }
81 inline void Unrealize () const { XtUnrealizeWidget (widget); }
82 inline Boolean IsRealized () const { return XtIsRealized (widget); }
83 inline void Destroy () const { XtDestroyWidget (widget); }
84 inline XtAppContext AppContext () const
85 { return (XtWidgetToApplicationContext (widget)); }
87 inline Arg& Get (Arg& a) const {
88 XtGetValues (widget, &a, 1);
92 inline Arg& _Get (Arg& a) const {
93 XtGetValues (widget, &a, 1);
97 inline void Get (ArgList a, Cardinal c) const {
98 XtGetValues (widget, a, c);
101 inline const WArgList& Get (const WArgList& wa) const {
102 XtGetValues (widget, wa.args, wa.num_args);
106 inline Arg& Set (Arg& a) const {
107 XtSetValues (widget, &a, 1);
111 inline Arg& _Set (Arg& a) const {
112 XtSetValues (widget, &a, 1);
116 inline void Set (ArgList a, Cardinal c) const {
117 XtSetValues (widget, a, c);
120 inline void Set (const WArgList& wa) const {
121 XtSetValues (widget, wa.args, wa.num_args);
124 inline void AddCallback (const char* name, XtCallbackProc proc,
125 caddr_t closure = NULL) const {
126 XtAddCallback (widget, name, proc, closure);
129 inline void RemoveCallback (const char* name, XtCallbackProc proc,
130 caddr_t closure = NULL) const {
131 XtRemoveCallback (widget, name, proc, closure);
134 inline void AddCallbacks (const char* name, XtCallbackList callbacks)
136 XtAddCallbacks (widget, name, callbacks);
139 inline void RemoveCallbacks (const char* name, XtCallbackList callbacks)
141 XtRemoveCallbacks (widget, name, callbacks);
144 inline void RemoveAllCallbacks (const char* name) const {
145 XtRemoveAllCallbacks (widget, name);
148 inline void CallCallbacks (const char* name, caddr_t call_data) const {
149 XtCallCallbacks (widget, name, call_data);
152 inline WCallback* _SetCallback (const char* name, WWL* obj, WWL_FUN fun,
154 return new WCallback (*this, name, obj, fun, client);
157 inline WCallback* SetCallback (const char* name, WWL* obj, WWL_FUN fun,
159 return new WCallback (*this, name, obj, fun, client);
161 DEFINE_CALLBACK (DestroyCallback,"destroyCallback")
164 #define NULLWObject WObject((Widget)0)