remove OSF1 support
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / wwl / include / WWL / WObject.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  * $TOG: WObject.h /main/6 1997/12/29 10:29:50 bill $
25  *
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.
30  * 
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.
34  * 
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
41  * 
42  */
43
44 // This code is automatically generated in -*- C++ -*-
45 #ifndef WObject_h
46 #define WObject_h
47
48 #include "wwl.h"
49 #include <X11/Object.h>
50
51 class WObject {
52
53   protected :
54         Widget  widget;
55 public :
56 inline          WObject () { widget = NULL; }
57 inline          WObject (Widget w) {
58                    widget = w;
59                 }
60 inline          WObject (const WObject& w) {
61                    widget = w.widget;
62                 }
63                 WObject (const WComposite& super, WidgetClass c,
64                          const char* name = NULL, ArgList args = NULL,
65                          Cardinal card = 0);
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,
71                          Cardinal card = 0);
72
73 inline          operator Widget () const { return widget; }
74 #ifndef DEC
75 inline  int     operator== (int i)      { return (Widget)(size_t)i == widget; }
76 inline  int     operator!= (int i)      { return (Widget)(size_t)i != widget; }
77 #endif
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)); }
86
87 inline  Arg&    Get (Arg& a) const {
88                    XtGetValues (widget, &a, 1);
89                    return a;
90                 }
91
92 inline  Arg&    _Get (Arg& a) const {
93                    XtGetValues (widget, &a, 1);
94                    return a;
95                 }
96
97 inline  void    Get (ArgList a, Cardinal c) const {
98                    XtGetValues (widget, a, c);
99                 }
100
101 inline  const WArgList& Get (const WArgList& wa) const {
102                    XtGetValues (widget, wa.args, wa.num_args);
103                    return wa;
104                 }
105
106 inline  Arg&    Set (Arg& a) const {
107                    XtSetValues (widget, &a, 1);
108                    return a;
109                 }
110
111 inline  Arg&    _Set (Arg& a) const {
112                    XtSetValues (widget, &a, 1);
113                    return a;
114                 }
115
116 inline  void    Set (ArgList a, Cardinal c) const {
117                    XtSetValues (widget, a, c);
118                 }
119
120 inline  void    Set (const WArgList& wa) const {
121                    XtSetValues (widget, wa.args, wa.num_args);
122                 }
123
124 inline  void    AddCallback (const char* name, XtCallbackProc proc,
125                              caddr_t closure = NULL) const {
126                    XtAddCallback (widget, name, proc, closure);
127                 }
128
129 inline  void    RemoveCallback (const char* name, XtCallbackProc proc,
130                                 caddr_t closure = NULL) const {
131                    XtRemoveCallback (widget, name, proc, closure);
132                 }
133
134 inline  void    AddCallbacks (const char* name, XtCallbackList callbacks)
135                 const {
136                    XtAddCallbacks (widget, name, callbacks);
137                 }
138
139 inline  void    RemoveCallbacks (const char* name, XtCallbackList callbacks)
140                 const {
141                    XtRemoveCallbacks (widget, name, callbacks);
142                 }
143
144 inline  void    RemoveAllCallbacks (const char* name) const {
145                    XtRemoveAllCallbacks (widget, name);
146                 }
147
148 inline  void    CallCallbacks (const char* name, caddr_t call_data) const {
149                    XtCallCallbacks (widget, name, call_data);
150                 }
151
152 inline  WCallback*      _SetCallback (const char* name, WWL* obj, WWL_FUN fun,
153                                       void* client=0) {
154                    return new WCallback (*this, name, obj, fun, client);
155                 }
156
157 inline  WCallback*      SetCallback (const char* name, WWL* obj, WWL_FUN fun,
158                                      void* client=0) {
159                    return new WCallback (*this, name, obj, fun, client);
160                 }
161                 DEFINE_CALLBACK (DestroyCallback,"destroyCallback")
162 };
163
164 #define NULLWObject             WObject((Widget)0)
165
166 #endif