Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtmail / MotifApp / MotifCmds.C
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 librararies 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 /* $TOG: MotifCmds.C /main/5 1998/09/21 18:49:41 mgreess $ */
24 /*
25  *+SNOTICE
26  *
27  *      RESTRICTED CONFIDENTIAL INFORMATION:
28  *      
29  *      The information in this document is subject to special
30  *      restrictions in a confidential disclosure agreement bertween
31  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
32  *      document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
33  *      Sun's specific written approval.  This documment and all copies
34  *      and derivative works thereof must be returned or destroyed at
35  *      Sun's request.
36  *
37  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
38  *
39  *+ENOTICE
40  */
41 #include "MotifCmds.h"
42
43 SeparatorCmd::SeparatorCmd ( 
44     char *name, 
45     char *,
46     int active 
47 ) : Cmd ( name, NULL, active )
48 {
49 }
50
51
52 void
53 SeparatorCmd::doit()
54 {
55 }
56
57
58 void
59 SeparatorCmd::undoit()
60 {
61
62 }
63
64
65 ToggleButtonCmd::ToggleButtonCmd ( 
66     char *name, 
67     char *label,
68     int active,
69     Boolean visible_when_off,
70     unsigned char indicator_type
71 ) : Cmd ( name, label, active )
72 {
73     _indicator_type = indicator_type;
74     _visible_when_off = visible_when_off;
75 }
76
77
78 void
79 ToggleButtonCmd::doit()
80 {
81 }
82
83
84 void
85 ToggleButtonCmd::undoit()
86 {
87
88 }
89
90
91 // Returns TRUE if button is ON, FALSE if OFF.
92
93 Boolean
94 ToggleButtonCmd::getButtonState()
95 {
96    CmdInterface *ci;
97    Widget toggleButton;
98
99    if (!_ci) return(NULL);
100
101    ci = _ci[0];
102
103    toggleButton = ci->baseWidget();
104
105    return (XmToggleButtonGetState(toggleButton));
106
107 }
108
109 void
110 ToggleButtonCmd::setButtonState(
111     Boolean state,
112     Boolean notify
113 )
114 {
115     
116     CmdInterface *ci;
117     Widget toggleButton;
118
119     if (!_ci) return;
120
121     ci = _ci[0];
122
123     if (ci) {
124         toggleButton = ci->baseWidget();
125
126         XmToggleButtonSetState(toggleButton, state, notify);
127     }
128 }
129
130 #ifndef CAN_INLINE_VIRTUALS
131 const char *const
132 ToggleButtonCmd::className( void )
133 {
134     return "ToggleButtonCmd";
135 }
136 #endif /* ! CAN_INLINE_VIRTUALS */
137
138 unsigned char
139 ToggleButtonCmd::indicatorType( void )
140 {
141     return _indicator_type;
142 }
143
144 Boolean
145 ToggleButtonCmd::visibleWhenOff( void )
146 {
147     return _visible_when_off;
148 }