dtcm: Coverity 88107
[oweals/cde.git] / cde / programs / dtwm / PanelS.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 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 ***     
25 ***     file:           PanelS.c
26 ***
27 ***     project:        MotifPlus Widgets
28 ***
29 ***     description:    Source code for DtPanelShell class.
30 ***     
31 ***
32 ***                     (c) Copyright 1992 by Hewlett-Packard Company.
33 ***
34 ***
35 ***-------------------------------------------------------------------*/
36
37
38 /*-------------------------------------------------------------
39 **      Include Files
40 */
41
42 #include <Xm/XmP.h>
43
44 #include <X11/Xatom.h>
45 #include <X11/StringDefs.h>
46 #include <X11/Shell.h>
47 #include <X11/ShellP.h>
48 #include <Dt/DtStrDefs.h>
49
50 #include "PanelSP.h"
51
52
53 /********    Public Function Declarations    ********/
54
55 /********    End Public Function Declarations    ********/
56
57 /********    Static Function Declarations    ********/
58
59
60 /********    End Static Function Declarations    ********/
61
62
63 \f
64 /*-------------------------------------------------------------
65 **      Resource List
66 */
67 #define R_Offset(field) \
68         XtOffset (DtPanelShellWidget, panel.field)
69
70 static XtResource panelResources[]=
71     {
72         {
73         XmNresolution,
74         XmCDimension, XmRDimension, sizeof (Dimension),
75         R_Offset (resolution), XmRImmediate, (XtPointer) 0
76         },
77         {
78         XmNhighResFontList,
79         XmCHighResFontList, XmRFontList, sizeof (XmFontList),
80         R_Offset (high_res_font_list), XmRString, (XtPointer) "fixed"
81         },
82         {
83         XmNmediumResFontList,
84         XmCMediumResFontList, XmRFontList, sizeof (XmFontList),
85         R_Offset (medium_res_font_list), XmRString, (XtPointer) "fixed"
86         },
87         {
88         XmNlowResFontList,
89         XmCLowResFontList, XmRFontList, sizeof (XmFontList),
90         R_Offset (low_res_font_list), XmRString, (XtPointer) "fixed"
91         }
92     };
93
94
95 \f
96 /*-------------------------------------------------------------
97 **      Class Record
98 */
99
100 static CompositeClassExtensionRec compositeClassExtension =
101     {
102     /* next_extension   */      NULL,
103     /* record_type      */      NULLQUARK,
104     /* version          */      XtCompositeExtensionVersion,
105     /* record_size      */      sizeof(CompositeClassExtensionRec),
106     /* accepts_objects  */      TRUE
107     };
108
109 DtPanelShellClassRec dtPanelShellClassRec =
110   {
111 /*      Core Part
112  */
113     {
114     /* superclass         */    (WidgetClass) &topLevelShellClassRec,
115     /* class_name         */    "FrontPanel",
116     /* size               */    sizeof(DtPanelShellRec),
117     /* Class Initializer  */    NULL,
118     /* class_part_initialize*/  NULL,
119     /* Class init'ed ?    */    FALSE,
120     /* initialize         */    NULL,
121     /* initialize_notify  */    NULL,           
122     /* realize            */    XtInheritRealize,
123     /* actions            */    NULL,
124     /* num_actions        */    0,
125     /* resources          */    panelResources,
126     /* resource_count     */    XtNumber(panelResources),
127     /* xrm_class          */    NULLQUARK,
128     /* compress_motion    */    FALSE,
129     /* compress_exposure  */    XtExposeCompressMaximal,
130     /* compress_enterleave*/    FALSE,
131     /* visible_interest   */    FALSE,
132     /* destroy            */    NULL,
133     /* resize             */    XtInheritResize,
134     /* expose             */    NULL,
135     /* set_values         */    NULL,
136     /* set_values_hook    */    NULL,                   
137     /* set_values_almost  */    XtInheritSetValuesAlmost,
138     /* get_values_hook    */    NULL,                   
139     /* accept_focus       */    NULL,
140     /* intrinsics version */    XtVersion,
141     /* callback offsets   */    NULL,
142     /* tm_table           */    XtInheritTranslations,
143     /* query_geometry     */    NULL,
144     /* display_accelerator*/    NULL,
145     /* extension          */    NULL
146     },
147 /*      Composite Part
148  */
149     {
150     /* geometry_manager   */    XtInheritGeometryManager,
151     /* change_managed     */    XtInheritChangeManaged,
152     /* insert_child       */    XtInheritInsertChild,
153     /* delete_child       */    XtInheritDeleteChild,
154     /* extension          */    (XtPointer)&compositeClassExtension
155     },
156 /*      Constraint Part
157  */
158     {
159     /* extension          */    NULL
160     },
161     {
162     /* extension          */    NULL
163     },
164     {
165     /* extension          */    NULL
166     },
167     {
168     /* extension          */    NULL
169     }
170   };
171
172 WidgetClass dtPanelShellWidgetClass = (WidgetClass) &dtPanelShellClassRec;
173
174
175 \f
176 /*-------------------------------------------------------------
177 **      Private Procs
178 **-------------------------------------------------------------
179 */
180
181
182 /*-------------------------------------------------------------
183 **      Core Procs
184 **-------------------------------------------------------------
185 */
186